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

24 lines
635 B
C#
Raw Normal View History

2021-11-26 11:16:25 +03:00
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;
}
}