Beispiel #1
0
        public void SaveGame()
        {
            foreach (Component module in _gameModules.Values)
            {
                (module as IEngineModule).CleanupBeforeSave();
            }

            BaseSceneObject[] sds = GameObject.FindObjectsOfType <BaseSceneObject>();
            foreach (BaseSceneObject sd in sds)
            {
                sd.SaveGame(TheGameState);
            }

            foreach (Component module in _gameModules.Values)
            {
                (module as IEngineModule).OnSave(TheGameState);
            }

            ActiveObjectsManager.Instance.SaveGame(TheGameState);
            if (EJRConsts.Instance["usePlayerController"] == "true")
            {
                ThePlayerController.SaveGame(TheGameState);
            }
            SettingsManager.Instance.SaveGame(TheGameState);
            TheGameState.SaveGame();
        }
Beispiel #2
0
 //player died and the game needs to be restarted
 public void RestartAfterDeath()
 {
     TheGameState.ClearAllKeys();
     TheGameState.SaveGame();
     StartManager.Instance.ReloadGame();
 }