//Save the whole state of this saveState public void saveNewGame() { state = new SaveState(true); // dont update the username and password when making new game if (!"".Equals(GameManager.instance.saveFile.username)) { state.username = GameManager.instance.saveFile.username; state.password = GameManager.instance.saveFile.password; } PlayerPrefs.SetString("save", OtherMethod.serialize <SaveState>(state)); GameManager.instance.saveFile = state; }
// save the game when updated public void saveAndUpdate() { state = GameManager.instance.saveFile; PlayerPrefs.SetString("save", OtherMethod.serialize <SaveState>(state)); }