_xiaofang/xiaofang/Assets/Script/login/Singleton.cs
2024-11-21 13:55:05 +08:00

21 lines
359 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
public class Singleton<T> where T : new()
{
private static T ms_instance;
public static T Instance
{
get
{
if (ms_instance == null)
{
ms_instance = new T();
}
return ms_instance;
}
}
}