Пример #1
0
        public static void SaveGameState(int slot)
        {
            if (GameManager.isInMainMenuScene)
            {
                Debug.LogWarning("Cant save in main menu scene");
                return;
            }
            Debug.Log("Saving game");



            // TODO: pass in list of all currently loaded scenes

            // Scene[] allActiveLoadedScenes = SceneLoading.allCurrentLoadedScenes;
            // let everyone know we're saving
            if (onSaveGame != null)
            {
                onSaveGame(SceneLoading.currentLoadedScenes);
            }

            // TODO: make this the scene player is currently part of
            // keep track of the scene we were in when saving
            string playerScene = SceneLoading.playerScene;

            SystemTools.SaveToFile(new GameSaveStateInfo(playerScene), GetGameSaveInfoPath(slot));
            SystemTools.SaveToFile(gameSaveState.saveState, GetGameSavePath(slot));
        }
Пример #2
0
 // call when we're done editng any settings, or when we're quittin ghte application
 public static void SaveSettingsOptions()
 {
     Debug.Log("Saving Settings");
     // let everyone know we're saving settings
     if (onSaveSettingsOptions != null)
     {
         onSaveSettingsOptions();
     }
     SystemTools.SaveToFile(settingsSaveState.saveState, GetGameSettingsOptionsPath());
 }
Пример #3
0
        public static void SaveGameState(int slot)
        {
            if (GameManager.isInMainMenuScene)
            {
                Debug.LogWarning("Cant save in main menu scene");
                return;
            }
            Debug.Log("Saving game");
            // keep track of the scene we were in when saving
            Scene currentScene = SceneLoading.currentScene;

            // let everyone know we're saving
            if (onSaveGame != null)
            {
                onSaveGame(currentScene);
            }

            SystemTools.SaveToFile(new GameSaveStateInfo(currentScene.name), GetGameSaveInfoPath(slot));
            SystemTools.SaveToFile(gameSaveState.saveState, GetGameSavePath(slot));
        }