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

32 lines
670 B
C#
Raw Permalink Normal View History

2021-11-26 11:16:25 +03:00
using System;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class SliderHandle : MonoBehaviour
{
public bool HandleIsPressed { get; set; }
public bool IsShowing => gameObject.activeSelf;
private Image _image;
private void OnDisable()
{
HandleIsPressed = false;
}
private void Awake()
{
_image = transform.Find("BehaviourIcon").GetComponent<Image>();
}
public void SetShowState(bool isActive)
{
gameObject.SetActive(isActive);
}
public void SetHandleSprite(Sprite sprite)
{
_image.sprite = sprite;
}
}