单例基类
public class CSingletonBase<TYPE> { public static TYPE Singleton { get { return m_singletion; } set { m_singletion = value; } } private static TYPE m_singletion = default(TYPE); }
具体的单例定义
public class ClientShop : CSingleton<ClientShop> { public void Debug() { } }
单例调用
public class Main {
void Test() { ClientShop.Singleton.Debug(); } }