namespace TEngineCore
{
///
/// 通用单例,无需释放和销毁
///
///
public class Singleton where T : new()
{
private static T _instance;
public static T Instance
{
get
{
if (_instance == null)
{
_instance = new T();
}
return _instance;
}
}
public static T Active()
{
return Instance;
}
}
}