コード例 #1
0
ファイル: SaveScumCop.cs プロジェクト: RistoPaasivirta/IOX
 private void OnApplicationPause(bool pause)
 {
     if (pause)
     {
         SaveLoadSystem.SaveStash();
         SaveLoadSystem.SaveGame();
     }
 }
コード例 #2
0
 private void Awake()
 {
     GetComponent <GUIButton>().onClick.AddListener(() =>
     {
         SaveLoadSystem.SaveStash();
         SaveLoadSystem.SaveGame();
         LevelLoader.DestroyLevel();
         SceneManager.LoadScene(SceneToLoad);
     });
 }
コード例 #3
0
    private void Awake()
    {
        GetComponent <GUIButton>().onClick.AddListener(() =>
        {
            if (SaveGameOnQuit)
            {
                SaveLoadSystem.SaveStash();
                SaveLoadSystem.SaveGame();
            }

            Application.Quit();
        });
    }
コード例 #4
0
    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();
    }
コード例 #5
0
ファイル: SaveScumCop.cs プロジェクト: RistoPaasivirta/IOX
 private void OnApplicationQuit()
 {
     SaveLoadSystem.SaveStash();
     SaveLoadSystem.SaveGame();
 }