mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 05:27:13 +08:00
(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