随手一记-单例模式写法

public class GameDataPreLoad
{
    static private GameDataPreLoad _instance;
    static public GameDataPreLoad Instance
    {
        get
        {
            if (_instance == null)
            {
                _instance = new GameDataPreLoad();
            }

            return _instance;
        }
    }
}

 

posted @ 2017-10-16 21:35  叫我张先生  阅读(113)  评论(0编辑  收藏  举报