[+] GameTickWacher

[+] GameTickWacher
This commit is contained in:
ALEXTANG
2023-04-20 19:34:01 +08:00
parent 385d789c96
commit 069c5b93e0
4 changed files with 50 additions and 2 deletions

View File

@@ -0,0 +1,27 @@
using TEngine;
namespace GameBase
{
/// <summary>
/// 通用单例。
/// </summary>
/// <typeparam name="T">泛型T。</typeparam>
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;
}
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b68a449df312429cbb27873984ec238e
timeCreated: 1681214042