提交项目

This commit is contained in:
2026-06-15 11:34:31 +08:00
commit 43d6c0125d
5698 changed files with 1236396 additions and 0 deletions
@@ -0,0 +1,37 @@
using System;
namespace BingoBrain.Core
{
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()
{
}
}
}