Files
2026-02-21 16:45:37 +08:00

31 lines
495 B
C#

using UnityEngine;
public class KGFObject : MonoBehaviour
{
public KGFDelegate EventOnAwake = new KGFDelegate();
public KGFDelegate EventOnDestroy = new KGFDelegate();
protected virtual void Awake()
{
KGFAccessor.AddKGFObject(this);
EventOnAwake.Trigger(this);
KGFAwake();
}
private void OnDestroy()
{
EventOnDestroy.Trigger(this);
KGFAccessor.RemoveKGFObject(this);
KGFDestroy();
}
protected virtual void KGFAwake()
{
}
protected virtual void KGFDestroy()
{
}
}