forked from zxl/LaboratoryProtection
18 lines
343 B
C#
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);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|