Skip to content

Instantly share code, notes, and snippets.

@mandarinx
mandarinx / ScrollRectAutoScroll.cs
Created August 22, 2017 11:30 — forked from QubitsDev/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;
[RequireComponent(typeof(ScrollRect))]
public class ScrollRectAutoScroll : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
public float scrollSpeed = 10f;
private bool mouseOver = false;