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

18 lines
353 B
C#

using UnityEngine;
namespace PMaker.DependencyInjection
{
public class SingletonMonobehaviour : BaseBehaviour
{
protected virtual void Awake()
{
IoC.AddSingleton(this.GetType(), this);
}
protected virtual void OnDestroy()
{
IoC.RemoveSingleton(this.GetType());
}
}
}