Beispiel #1
0
        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();
            }
        }
Beispiel #2
0
 public static void SaveGame(string name) => OnSaveGame?.Invoke(name);
Beispiel #3
0
 public static void RaiseOnSaveGameEvent()
 {
     OnSaveGame?.Invoke();
 }
 public void SaveGame(GameData gameData, SelectedProfile selectedProfile)
 {
     OnSaveGame?.Invoke(gameData, selectedProfile);
 }