赞
踩
using UnityEngine.UI; using UnityEngine.EventSystems; using System; public class MySlider : Slider, IBeginDragHandler, IEndDragHandler { public Action beiginDrag = null; public Action endDrag = null; public void OnBeginDrag(PointerEventData eventData) { beiginDrag?.Invoke(); } public void OnEndDrag(PointerEventData eventData) { endDrag?.Invoke(); } }
下面是调用方法
public MySlider slider;
void Awake()
{
slider.beiginDrag = BeiginDrag;
slider.endDrag = EndDrag;
}
private void EndDrag()
{
}
private void BeiginDrag()
{
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。