Esempio n. 1
0
 public static GameSaveStateInfo GetSaveDescription(int slot)
 {
     if (!SaveExists(slot))
     {
         return(null);
     }
     return((GameSaveStateInfo)SystemTools.LoadFromFile(GetGameSaveInfoPath(slot)));
 }
Esempio n. 2
0
        // call when starting up game
        public static void LoadSettingsOptions()
        {
            string savePath = GetGameSettingsOptionsPath();

            if (!File.Exists(savePath))
            {
                return;
            }
            Debug.Log("Starting Settings Load");
            settingsSaveState.Reinitialize((Dictionary <string, object>)SystemTools.LoadFromFile(savePath));
            if (onSettingsOptionsLoaded != null)
            {
                onSettingsOptionsLoaded();
            }
        }
Esempio n. 3
0
        public static void LoadGameState(int slot)
        {
            string savePath = GetGameSavePath(slot);

            if (!File.Exists(savePath))
            {
                Debug.LogError("No Save File Found For Slot " + slot.ToString());
                return;
            }

            Debug.Log("Starting Load");

            isLoadingSaveSlot = true;

            GameSaveStateInfo savedStateInfo = GetSaveDescription(slot);

            string sceneFromSave = savedStateInfo.sceneName;

            // load the actual save state
            Action <LoadSceneMode> onSceneStartLoad = (mode) => gameSaveState.Reinitialize((Dictionary <string, object>)SystemTools.LoadFromFile(savePath));

            Action <string, LoadSceneMode> onSceneLoaded = (s, mode) => isLoadingSaveSlot = false;

            if (!SceneLoading.LoadSceneAsync(sceneFromSave, onSceneStartLoad, onSceneLoaded, LoadSceneMode.Single, false))
            {
                isLoadingSaveSlot = false;
            }
        }