using UnityEngine.EventSystems; using UnityEngine.UI; public class CustomSlider : Slider { public SliderHandle Handle { get; private set; } protected override void Awake() { Handle = transform.Find("Handle Slide Area/Handle").gameObject.GetComponent(); } public override void OnPointerDown(PointerEventData eventData) { base.OnPointerDown(eventData); Handle.HandleIsPressed = true; } public override void OnPointerUp(PointerEventData eventData) { base.OnPointerUp(eventData); Handle.HandleIsPressed = false; } }