提交项目

This commit is contained in:
2026-06-12 10:11:36 +08:00
commit 65acce7dde
5920 changed files with 629434 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
using System;
namespace LoveLegend
{
public class Singleton<T> : ISingleton, IDisposable where T : Singleton<T>, new()
{
private static T mInstance;
private static readonly object LockObject = new();
public static T Instance
{
get
{
lock (LockObject)
{
mInstance ??= new T();
mInstance.OnSingletonInit();
}
return mInstance;
}
}
public virtual void Dispose()
{
mInstance = null;
}
public void OnSingletonInit()
{
}
}
}