Files
BITKit/Src/Unity/Scripts/Components/AutoInvoke.cs
2023-09-02 00:51:39 +08:00

35 lines
777 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
namespace BITKit
{
public class AutoInvoke : MonoBehaviour
{
public UnityEvent onAwake = new();
public UnityEvent onStart = new();
public UnityEvent onEnabled = new();
public UnityEvent onDisabled = new();
public UnityEvent onDestory = new();
void Awake()
{
onAwake.Invoke();
}
void Start()
{
onStart.Invoke();
}
void OnEnabled()
{
onEnabled.Invoke();
}
void OnDisable()
{
onDisabled.Invoke();
}
void OnDestroy()
{
onDestory.Invoke();
}
}
}