quantum-space-buddies/QSB/Utility/OnEnableDisableTracker.cs

15 lines
362 B
C#
Raw Normal View History

2021-01-26 14:07:17 +00:00
using UnityEngine;
namespace QSB.Utility
{
public delegate void EnableDisableEvent();
public class OnEnableDisableTracker : MonoBehaviour
{
public event EnableDisableEvent OnEnableEvent;
public event EnableDisableEvent OnDisableEvent;
private void OnEnable() => OnEnableEvent?.Invoke();
private void OnDisable() => OnDisableEvent?.Invoke();
}
}