Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (WindowSelector.ReadThrough() &&
            WindowSelector.ThisWindow.IsActive &&
            WindowSelector.ThisWindow.IsVisible &&
            Selected == 0)
        {
            Selected = WindowSelector.Read(Player);
        }
        else if (Selected > 0)
        {
            switch (Selected)
            {
            case 1:
            {
                NewMessage.NewMessage("Saving Data...", Player, false);
                Player.ThisPlayer.SceneName     = SceneManager.GetActiveScene().name;
                Player.ThisPlayer.SavedLocation = PlayerObject.transform.position;
                DataManager.SaveData(Player.ThisPlayer);
                StartCoroutine(WaitIllusion(1, 3.0f));
                break;
            }

            case 2:
            {
                NewMessage.NewMessage("Loading Data...", Player, false);
                StartCoroutine(WaitIllusion(2, 5.0f));
                break;
            }

            case 3:
            {
                NewMessage.NewMessage("Exiting Game", Player, false);
                StartCoroutine(WaitIllusion(3, 3.0f));
                break;
            }
            }
            Selected = 0;
        }

        if (NewMessage.ReadThrough() &&
            NewMessage.ThisWindow.IsActive &&
            NewMessage.ThisWindow.IsVisible)
        {
            NewMessage.Read(Player);
        }

        InputBasedOnPlayerStatus();

        if (!WindowSelector.ReadThrough())
        {
            WindowSelector.InputisHere = false;
        }
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (WindowSelector.ReadThrough() &&
            WindowSelector.ThisWindow.IsActive &&
            WindowSelector.ThisWindow.IsVisible &&
            Selected == 0)
        {
            Selected = WindowSelector.Read(Player);
        }
        else if (Selected > 0)
        {
            switch (Selected)
            {
            case 1:
            {
                GameObject.Find("PlayerInput").transform.position = Vector3.zero;
                break;
            }

            case 2:
            {
                WindowSelector.HideWindow();
                SceneManager.LoadScene(Player.ThisPlayer.SceneName);
                break;
            }

            case 3:
            {
#if UNITY_EDITOR
                UnityEditor.EditorApplication.isPlaying = false;
#else
                Application.Quit();
#endif
                break;
            }
            }
            Selected = 0;
        }

        if (NewMessage.ReadThrough() &&
            NewMessage.ThisWindow.IsActive &&
            NewMessage.ThisWindow.IsVisible)
        {
            NewMessage.Read(Player);
        }

        if (!WindowSelector.ReadThrough())
        {
            WindowSelector.InputisHere = false;
        }
    }
Exemplo n.º 3
0
    public void GameOver()
    {
        if (WindowSelector.ReadThrough() &&
            WindowSelector.ThisWindow.IsActive &&
            WindowSelector.ThisWindow.IsVisible &&
            Selected == 0)
        {
            Selected = WindowSelector.Read(Player);
        }
        else if (Selected > 0)
        {
            switch (Selected)
            {
            case 1:
            {
                NewMessage.NewMessage("Loading Data...", Player, false);
                Player.ThisPlayer.SceneName     = SceneManager.GetActiveScene().name;
                Player.ThisPlayer.SavedLocation = PlayerObject.transform.position;
                NewMessage.HideWindow();
                WindowSelector.HideWindow();
                SceneManager.LoadScene(Player.ThisPlayer.SceneName);
                break;
            }

            case 2:
            {
                NewMessage.NewMessage("Exiting Game", Player, false);
#if UNITY_EDITOR
                UnityEditor.EditorApplication.isPlaying = false;
#else
                Application.Quit();
#endif
                break;
            }
            }
            Selected = 0;
        }

        if (NewMessage.ReadThrough() &&
            NewMessage.ThisWindow.IsActive &&
            NewMessage.ThisWindow.IsVisible)
        {
            NewMessage.Read(Player);
        }

        if (!WindowSelector.ReadThrough())
        {
            WindowSelector.InputisHere = false;
        }
    }