Exemplo n.º 1
0
        private void OnRequestRespawnMessage(RequestRespawnMessage inMessage)
        {
            if (ActiveController.PawnInstance == inMessage.RequestingPlayer)
            {
                /*
                 * ActiveController.PawnInitialTransform =
                 *  _spawnService.GetNearestSpawnLocation(inMessage.RequestingPlayer.transform.position);
                 *
                 * ActiveController.DestroyPawn();
                 * ActiveController.CreatePawnOfType(PlayerCharacterType);
                 */

                PersistenceFunctions.LoadCurrentSave(GameDataStorageConstants.SaveDataPath);
            }
        }
        public void LoadCurrentSave_GameInstanceSetupAsExpected()
        {
            var gameInstanceObject = new GameObject();

            gameInstanceObject.AddComponent <MockInputComponent>();
            var instance = gameInstanceObject.AddComponent <TestGameInstance>();

            instance.TestAwake();

            const string testPath = "TestSaveFile.dat";

            PersistenceFunctions.WriteCurrentSave(testPath, _service);
            PersistenceFunctions.LoadCurrentSave(testPath);

            Assert.IsNotNull(instance.NextSceneSaveData);
            Assert.AreEqual(SceneManager.GetActiveScene().path, instance.NextSceneToLoad);

            GameInstance.ClearGameInstance();
        }
Exemplo n.º 3
0
 protected void OnButtonPressed()
 {
     PersistenceFunctions.LoadCurrentSave(GameDataStorageConstants.SaveDataPath);
 }