void Awake() { string G1_P = PlayerPrefs.GetString("G1_P", ""); if (G1_P != "") { Game_P = JsonUtility.FromJson <G1_Game_P> (G1_P); } _ = this; }
void Start() { string Json = PlayerPrefs.GetString(Key, ""); if (Json != "") { Game_P = JsonUtility.FromJson <G1_Game_P> (Json); } else { print("沒記錄"); } Set_PUIs [0].Del += (f) => { Game_P.Max_HP = (int)f; }; Set_PUIs [1].Del += (f) => { Game_P.Max_Obj_Time_Length = f; }; Set_PUIs [2].Del += (f) => { Game_P.Min_Obj_Time_Length = f; }; Set_PUIs [3].Del += (f) => { Game_P.Time = (int)f; }; OKButt.Del += (g) => { PlayerPrefs.SetString(Key, JsonUtility.ToJson(Game_P)); SceneManager.LoadScene("G1"); }; Open(); }