1
This commit is contained in:
26
Unity/Scripts/UX/Utils/UXPanelEvent.cs
Normal file
26
Unity/Scripts/UX/Utils/UXPanelEvent.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user