(client) feat:Add Singleton and MonoSingleton class
This commit is contained in:
8
Client/Assets/Scripts/Utils/Singleton.cs
Normal file
8
Client/Assets/Scripts/Utils/Singleton.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Utils
|
||||
{
|
||||
public class Singleton<T> where T : new()
|
||||
{
|
||||
private static T _instance;
|
||||
public static T Instance => _instance ??= new T();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user