hellbound/Assets/Scripts/Game/UI/Elements/SliderControl/CustomSlider.cs

24 lines
635 B
C#

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<SliderHandle>();
}
public override void OnPointerDown(PointerEventData eventData)
{
base.OnPointerDown(eventData);
Handle.HandleIsPressed = true;
}
public override void OnPointerUp(PointerEventData eventData)
{
base.OnPointerUp(eventData);
Handle.HandleIsPressed = false;
}
}