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

32 lines
670 B
C#
Raw Normal View History

2021-12-29 20:50:11 +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;
}
}