public void SaveGame() { _saveFile.SavedDay = _gameManager.Day; _saveFile.SavedDayTimeLeft = _gameManager.DayTimeLeft; _saveFile.SavedPreparedVisitors = _gameManager.PreparedVisitors; _saveFile.SavedVisitorsInRowThisDay = _gameManager.VisitorsInRowThisDay; string jsonSaveFile = JsonUtility.ToJson(_saveFile, true); File.WriteAllText(_saveFilePath, jsonSaveFile); Debug.Log("Game was saved"); foreach (var observer in OnSaveGame.Enumerate()) { observer.Do(); } }
public static void SaveGame(string name) => OnSaveGame?.Invoke(name);
public static void RaiseOnSaveGameEvent() { OnSaveGame?.Invoke(); }
public void SaveGame(GameData gameData, SelectedProfile selectedProfile) { OnSaveGame?.Invoke(gameData, selectedProfile); }