Ejemplo n.º 1
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;
        }
    }
Ejemplo n.º 2
0
    IEnumerator WaitIllusion(int Action, float Duration)
    {
        Player.DoShomething();
        yield return(new WaitForSeconds(Duration));

        switch (Action)
        {
        case 1:
        {
            NewMessage.NewMessage("Save Complete!", Player, true);
            break;
        }

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

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


        //
    }
Ejemplo n.º 3
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;
        }
    }