MySlider.cs 419 B

12345678910111213141516171819
  1. using UnityEngine.UI;
  2. using UnityEngine.EventSystems;
  3. using System;
  4. public class MySlider : Slider, IBeginDragHandler, IEndDragHandler
  5. {
  6. public Action beiginDrag { get; set; }
  7. public Action endDrag { get; set; }
  8. public void OnBeginDrag(PointerEventData eventData)
  9. {
  10. beiginDrag?.Invoke();
  11. }
  12. public void OnEndDrag(PointerEventData eventData)
  13. {
  14. endDrag?.Invoke();
  15. }
  16. }