25 lines
557 B
C#
25 lines
557 B
C#
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class SetIsScrollableWhenPointerOver : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
|
|
{
|
|
public Transform Content;
|
|
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
if (Content == null)
|
|
{
|
|
GameManager.Instance.CurrentlyScrollable = base.gameObject.transform;
|
|
}
|
|
else
|
|
{
|
|
GameManager.Instance.CurrentlyScrollable = Content;
|
|
}
|
|
}
|
|
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
GameManager.Instance.CurrentlyScrollable = null;
|
|
}
|
|
}
|