调整目录结构
This commit is contained in:
24
Assets/Scripts/Model/Common/Services/MonoService.cs
Normal file
24
Assets/Scripts/Model/Common/Services/MonoService.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using NBC;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public abstract class MonoService : MonoBehaviour
|
||||
{
|
||||
}
|
||||
|
||||
public abstract class MonoService<T> : MonoService where T : MonoService
|
||||
{
|
||||
public static T Instance { get; private set; }
|
||||
|
||||
protected void Awake()
|
||||
{
|
||||
Instance = this as T;
|
||||
OnAwake();
|
||||
}
|
||||
|
||||
protected virtual void OnAwake()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user