BITKit/Packages/Runtime~/Unity/Scripts/UX/Utils/UXPanelEvent.cs

32 lines
745 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using BITKit;
using UnityEngine.Events;
namespace BITKit.UX
{
public class UXPanelEvent : MonoBehaviour, IPanelComponent
{
public UnityEvent<bool> onSetActive = new();
public UnityEvent onActive = new();
public UnityEvent onInactive = new();
public void SetActive(bool active)
{
onSetActive.Invoke(active);
if (active)
{
onActive.Invoke();
}
else
{
onInactive.Invoke();
}
}
public bool Enabled
{
get => enabled;
set => enabled = value;
}
}
}