Files
TEngine/Assets/GameScripts/HotFix/GameBase/Singleton.cs
2023-04-19 15:41:55 +08:00

23 lines
433 B
C#

using TEngine;
namespace GameBase
{
public class Singleton<T> where T:new()
{
private static T _instance;
public static T Instance
{
get
{
if (null == _instance)
{
_instance = new T();
Log.Assert(_instance != null);
}
return _instance;
}
}
}
}