Skip to content

Instantly share code, notes, and snippets.

@spireggs
spireggs / ScrollRectAutoScroll.cs
Last active January 8, 2024 18:28 — forked from mandarinx/ScrollRectAutoScroll.cs
Unity3d ScrollRect Auto-Scroll, Dropdown Use: Places this component in the Template of Dropdown (with the ScrollRect component)
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
//comment the next line out if you aren't using Rewired
using Rewired;
[RequireComponent(typeof(ScrollRect))]
public class ScrollRectAutoScroll : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{