LaboratoryProtection/Assets/PMaker/Scripts/IoC/InstanceMonobehaviour.cs

18 lines
343 B
C#

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);
}
}
}