//Functionality for saving a game of Chinese Checkers //The SaveGame method is found in the InputManagerScript public void SaveGame() { StreamWriter saveState = File.CreateText(Application.persistentDataPath + "/state.dat"); string state = GM.GetCurrentState(); saveState.WriteLine(state); saveState.Close(); } //The GetState method is found in the GameManagerScript public string GetState() { string currentState = ""; for (int i = 0; i < board.Length; i++) { for (int j = 0; j < board[i].Count; j++) { currentState += board[i][j].ReportState(); } } return (currentState); } //Every tile in the gameboard has a TileScript-component, containing the ReportState method public string ReportState() { if (Occupied && this.CurrentMarble != null) { return (this.CurrentMarble.owner.playerName.ToString()); } else { return "0"; } }