音频内容

This commit is contained in:
2024-09-19 01:12:10 +08:00
parent 1c390954ce
commit 35bd460011
80 changed files with 2205 additions and 59 deletions
@@ -0,0 +1,36 @@
using UnityEngine;
namespace AibisDream.Kit
{
public abstract class Singleton<T> : MonoBehaviour, ISingleton where T : Singleton<T>
{
public static T Instance { get; private set; }
protected virtual void Awake()
{
if (Instance != null)
{
Destroy(gameObject);
}
else
{
Instance = (T)this;
OnSingletonInit();
}
}
public virtual void OnSingletonInit()
{
}
public static bool IsInitialized => Instance != null;
protected virtual void OnDestroy()
{
if (Instance == this)
{
Instance = null;
}
}
}
}