随手一记-单例模式写法

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

            return _instance;
        }
    }
}
原文地址:https://www.cnblogs.com/unityzc/p/7679000.html