void Awake()
    {
        string G0_P = PlayerPrefs.GetString("G0_P", "");

        if (G0_P != "")
        {
            Game_P = JsonUtility.FromJson <G0_Game_P> (G0_P);
        }
        // if (G0_Game_P._ != null) {
        //  Game_P = G0_Game_P._;
        // }
    }
Exemple #2
0
    void Start()
    {
        string Json = PlayerPrefs.GetString(Key, "");

        if (Json != "")
        {
            Game_P = JsonUtility.FromJson <G0_Game_P> (Json);
        }
        else
        {
            print("沒記錄");
        }

        Set_PUIs [0].Del += (f) =>
        {
            Game_P.Max_Time = (int)f;
        };
        Set_PUIs [1].Del += (f) =>
        {
            Game_P.Time_Up [0] = (int)f;
        };
        Set_PUIs [2].Del += (f) =>
        {
            Game_P.Time_Up [1] = (int)f;
        };
        Set_PUIs [3].Del += (f) =>
        {
            Game_P.HP_Dom_Speed = (int)f;
        };
        Set_PUIs [4].Del += (f) =>
        {
            Game_P.HP_Up_Speed = (int)f;
        };

        OKButt.Del += (g) =>
        {
            PlayerPrefs.SetString(Key, JsonUtility.ToJson(Game_P));
            SceneManager.LoadScene("G0");
        };

        Open();
    }