1
0
Fork 0
LaboratoryProtection/Assets/PMaker/Scripts/IoC/InstanceMonobehaviour.cs

18 lines
343 B
C#
Raw Normal View History

2023-09-12 15:55:51 +08:00
using UnityEngine;
namespace PMaker.DependencyInjection
{
public class InstanceMonobehaviour : BaseBehaviour
{
protected virtual void Awake()
{
IoC.AddInstance(this);
}
protected virtual void OnDestroy()
{
IoC.RemoveInstance(this.GetType(), this);
}
}
}