powerfun-unity/Assets/Cyp/MapListScript.cs
2021-03-25 16:55:36 +08:00

22 lines
580 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class MapListScript : MonoBehaviour, IEndDragHandler
{
public void OnEndDrag(PointerEventData eventData)
{
var sc = gameObject.transform.parent.GetComponent<MapList>();
if (eventData.position.y < 0)
{
sc.Refresh();
}
if (eventData.position.y + Screen.height > sc.Content.GetComponent<RectTransform>().rect.height)
{
sc.pageIndex++;
sc.GetList();
}
}
}