using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using Sirenix.OdinInspector; using KairoEngine.UI.InteractionHandler; namespace KairoEngine.UI { [HideMonoScript] public class TabButton : MonoBehaviour { public Button targetButton; public Sprite buttonGraphic; public Sprite buttonActiveGraphic; private bool active = false; public void SwitchState() { if(active) { active = false; targetButton.image.sprite = buttonGraphic; } else { active = true; targetButton.image.sprite = buttonActiveGraphic; } } public void Activate() { active = true; targetButton.image.sprite = buttonActiveGraphic; } public void Deactivate() { active = false; targetButton.image.sprite = buttonGraphic; } } }