private void OnApplicationPause(bool pause) { if (pause) { SaveLoadSystem.SaveStash(); SaveLoadSystem.SaveGame(); } }
private void Awake() { GetComponent <GUIButton>().onClick.AddListener(() => { SaveLoadSystem.SaveStash(); SaveLoadSystem.SaveGame(); LevelLoader.DestroyLevel(); SceneManager.LoadScene(SceneToLoad); }); }
private void Awake() { GetComponent <GUIButton>().onClick.AddListener(() => { if (SaveGameOnQuit) { SaveLoadSystem.SaveStash(); SaveLoadSystem.SaveGame(); } Application.Quit(); }); }
private void OnDeath() { Messaging.Player.Health.Invoke(0, 1); //Messaging.Player.Charge.Invoke(0, 1); //Messaging.Player.SoftDamage.Invoke(0); Messaging.CameraControl.RemoveShake.Invoke(); Messaging.System.SetTimeScale.Invoke(TimeScale.SuperSlowmo); Messaging.CameraControl.TargetRotation.Invoke(Random.value > .5f ? 90 : -90); //handle player info change instantly to make sure designator won't go ape shit SaveLoadSystem.SaveStash(); PlayerInfo.CurrentLocal.PlayerHasBeenInitialized = false; if (Difficulty.PermanentDeath) { SaveLoadSystem.DeletePlayerInfo(); } else { PlayerInfo.CurrentLocal.CurrentMap = SoftcoreDeathScene; SaveLoadSystem.SaveGame(); } float deathTimer = 0f; GameObject deadwaker = new GameObject("Dead Waker"); UpdateCallHook u = deadwaker.AddComponent <UpdateCallHook>(); u.OnUpdateCall.AddListener(() => { deathTimer += Time.unscaledDeltaTime; Messaging.GUI.Painflash.Invoke(1f); Messaging.GUI.Blackout.Invoke(deathTimer / 7f); if (deathTimer > 7f) { Destroy(deadwaker.gameObject); if (Difficulty.PermanentDeath) { UnityEngine.SceneManagement.SceneManager.LoadScene(HardcoreDeathScene); } else { Messaging.System.ChangeLevel.Invoke(SoftcoreDeathScene, 0); } } }); Messaging.Player.Death.Invoke(); }
private void OnApplicationQuit() { SaveLoadSystem.SaveStash(); SaveLoadSystem.SaveGame(); }