验证中...
Languages: C#
Categories: 游戏开发
Latest update 2018-12-09 10:37
不需要挂在组件上的单例
Raw Copy
/// <summary>
/// 注意继承本类的类请标记为sealed类, 由此避免多重继承
/// 本类并不保证单例的访问,若要确保单例存在请勿使用本类
/// </summary>
public class LazyEasyAccess<T> where T : new()
{
private static T _ins;
public static T Ins
{
get
{
if(_ins == null)
_ins = new T();
return _ins;
}
}
}

Comment list( 0 )

You need to Sign in for post a comment

Help Search

Gitee_you_jiang_zheng_wen Zheng_wen_close