usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usingUnityEngine;usingUnityEngine.Events;usingUnityEngine.EventSystems;usingUnityEngine.UI;public classSelfScrollView : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
{public class OnScrollMoveEvent : UnityEvent{ }
[NonSerialized]public OnScrollMoveEvent OnScrollMove = newOnScrollMoveEvent();publicRectTransform father;
GridLayoutGroup gridLayoutGroup;floattotalSizeY;
[SerializeField]floatcurValue;public floatCurValue
{get { return father.anchoredPosition.y /totalSizeY; }set{
SetScrollY(value);
curValue=value;
}
}public floatminValue;public floatmaxValue;
[Header("滑动速度倍率")]public float times =100f;
[Header("摩擦系数")]public float reduceTimes = 0.01f;
[Header("滑动系数")]public float addTimes =1f;public voidInit()