BITFALL/Assets/BITKit/Unity/Scripts/UX/Utils/UXWindowEvent.cs

34 lines
776 B
C#
Raw Normal View History

2023-10-02 23:24:56 +08:00
using System;
2023-06-08 14:09:50 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using BITKit;
using UnityEngine.Events;
namespace BITKit.UX
{
2023-10-02 23:24:56 +08:00
[Obsolete]
2023-06-08 14:09:50 +08:00
public class UXWindowEvent : MonoBehaviour, IWindowComponent
{
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();
}
}
2023-08-12 01:43:24 +08:00
public bool Enabled
{
get => enabled;
set => enabled = value;
}
2023-06-08 14:09:50 +08:00
}
}