Exemple #1
0
 private void OffSuccess3D()
 {
     menuScreen.Hide();
     StopDownload();
     stateManager.Show(Estado.noVR);
     PointCloudManager.Instance.LoadFile();
 }
Exemple #2
0
    IEnumerator HideScreen(MenuScreen screen)
    {
        screen.Hide();
        yield return(new WaitForSeconds(1f)); // FIXME: aaaa

        screen.gameObject.SetActive(false);
    }
Exemple #3
0
    /// <summary>
    /// Show a particular menu screen
    /// </summary>
    /// <param name="screen">The screen to show</param>
    /// <param name="fade">The transition time.</param>
    /// <param name="callback">A Callback function to call once the transition is complete</param>
    public void ShowScreen(MenuScreen screen, float fade = 0.5f, SimpleTween.Callback callback = null)
    {
        if (screen == null)
        {
            Debug.LogWarning("Attempting to show null Menu Screen");
            return;
        }

        MenuScreen currentScreen = CurrentScreen;

        // add the new screen to the history
        screenHistory.Push(screen);

        // hide the current screen before showing the new one
        if (currentScreen != null)
        {
            currentScreen.Hide(fade, MenuScreen.TransitionDirection.Forward, () => {
                screen.Show(fade, MenuScreen.TransitionDirection.Forward, callback);
            });
        }
        else
        {
            screen.Show(fade, MenuScreen.TransitionDirection.Forward, callback);
        }
    }
Exemple #4
0
    public void ResumeGame()
    {
        Time.timeScale = 1.0f;
        state          = GameState.Playing;

        SoundManager.PlaySfx("Pause");
        SoundManager.UnpauseMusic();
        pauseMenu.Hide(0.3f);
    }
Exemple #5
0
    /// <summary>
    /// Return to the previous menu screen in the history
    /// </summary>
    /// <param name="fade">Transition time</param>
    /// <param name="callback">Callback funtion to call when the transition is complete</param>
    public void GoBack(float fade = 0.5f, SimpleTween.Callback callback = null)
    {
        if (screenHistory.Count == 0)
        {
            return;
        }

        MenuScreen currentScreen = screenHistory.Pop();
        MenuScreen prevScreen    = screenHistory.Count == 0 ? null : screenHistory.Peek();

        // hide the current screen and then show the previous screen (if there is one).
        if (prevScreen != null)
        {
            currentScreen.Hide(fade, MenuScreen.TransitionDirection.Back, () => {
                prevScreen.Show(fade, MenuScreen.TransitionDirection.Back, callback);
            });
        }
        else
        {
            currentScreen.Hide(fade, MenuScreen.TransitionDirection.Back, callback);
        }
    }
Exemple #6
0
    /// <summary>
    /// Exits all of the menus without going back through the history
    /// </summary>
    /// <param name="fade">Transition time</param>
    /// <param name="callback">Callback function to call when the transition is complete</param>
    public void ExitAll(float fade = 0.5f, SimpleTween.Callback callback = null)
    {
        if (screenHistory.Count == 0)
        {
            return;
        }

        // hide the current menu screen
        MenuScreen currentScreen = screenHistory.Pop();

        currentScreen.Hide(fade, MenuScreen.TransitionDirection.Back, callback);

        // clear the history, since we have now completely exited the menus.
        screenHistory.Clear();
    }
    private void Init()
    {
        GameObject gameObject = GameObject.Find("InGameMenu");

        DebugUtils.Assert(gameObject, true);
        for (int i = 0; i < gameObject.transform.childCount; i++)
        {
            GameObject gameObject2 = gameObject.transform.GetChild(i).gameObject;
            MenuScreen component   = gameObject2.GetComponent <MenuScreen>();
            if (component)
            {
                component.m_MenuInGameManager = this;
                component.Hide();
                this.m_Screens[component.GetType()] = component;
            }
        }
        this.m_OutlineCamera = GameObject.Find("OutlineCamera").GetComponent <Camera>();
        this.m_Initialized   = true;
    }
        //ќбработка нажатий на клавиши
        void KeyboardHandle()
        {
            KeyboardState kbState = Keyboard.GetState();

            interval++;
            if (interval >= 5)
            {
                interval = 0;
                if (menuScreen.Enabled)
                {
                    if (kbState.IsKeyDown(Keys.Up))
                    {
                        currentMenuItem--;
                        if (currentMenuItem < 1)
                        {
                            currentMenuItem = 3;
                        }
                        menuScreen.GetKey(currentMenuItem);
                    }
                    if (kbState.IsKeyDown(Keys.Down))
                    {
                        currentMenuItem++;
                        if (currentMenuItem > 3)
                        {
                            currentMenuItem = 1;
                        }
                        menuScreen.GetKey(currentMenuItem);
                    }
                    if (kbState.IsKeyDown(Keys.Enter))
                    {
                        switch (currentMenuItem)
                        {
                        case 1:
                            menuScreen.Hide();
                            GameState.StartNewGame();
                            gameScreen.Show();
                            break;

                        case 2:
                            menuScreen.Hide();
                            helpScreen.Show();
                            break;

                        case 3:
                            Exit();
                            break;
                        }
                    }
                }
                if (gamePauseScreen.Enabled)
                {
                    if (kbState.IsKeyDown(Keys.Up))
                    {
                        currentMenuItem--;
                        if (currentMenuItem < 1)
                        {
                            currentMenuItem = 2;
                        }
                        gamePauseScreen.GetKey(currentMenuItem);
                    }
                    if (kbState.IsKeyDown(Keys.Down))
                    {
                        currentMenuItem++;
                        if (currentMenuItem > 2)
                        {
                            currentMenuItem = 1;
                        }
                        gamePauseScreen.GetKey(currentMenuItem);
                    }
                    if (kbState.IsKeyDown(Keys.Enter))
                    {
                        switch (currentMenuItem)
                        {
                        case 1:
                            GameState.IsPaused = false;
                            gamePauseScreen.Hide();
                            break;

                        case 2:
                            GameState.IsPaused = false;
                            gamePauseScreen.Hide();
                            gameScreen.Hide();
                            menuScreen.Show();
                            currentMenuItem = 1;
                            break;
                        }
                    }
                }
                if (gameRestartScreen.Enabled)
                {
                    GameState.ShowMenu = false;
                    if (kbState.IsKeyDown(Keys.Up))
                    {
                        currentMenuItem--;
                        if (currentMenuItem < 1)
                        {
                            currentMenuItem = 2;
                        }
                        gameRestartScreen.GetKey(currentMenuItem);
                    }
                    if (kbState.IsKeyDown(Keys.Down))
                    {
                        currentMenuItem++;
                        if (currentMenuItem > 2)
                        {
                            currentMenuItem = 1;
                        }
                        gameRestartScreen.GetKey(currentMenuItem);
                    }
                    if (kbState.IsKeyDown(Keys.Enter))
                    {
                        switch (currentMenuItem)
                        {
                        case 1:
                            GameState.IsPaused = false;
                            gameRestartScreen.Hide();
                            GameState.StartNewGame();
                            break;

                        case 2:
                            GameState.IsPaused = false;
                            gameRestartScreen.Hide();
                            gameScreen.Hide();
                            menuScreen.Show();
                            currentMenuItem = 1;
                            break;
                        }
                    }
                }
            }
            if (helpScreen.Enabled)
            {
                if (kbState.IsKeyDown(Keys.Escape))
                {
                    helpScreen.Hide();
                    menuScreen.Show();
                }
            }
            if (gameScreen.Enabled)
            {
                if (kbState.IsKeyDown(Keys.Escape))
                {
                    GameState.IsPaused = true;
                    gamePauseScreen.Show();
                    currentMenuItem = 1;
                }
                if (GameState.ShowMenu)
                {
                    GameState.IsPaused = true;
                    gameRestartScreen.Show();
                    currentMenuItem = 1;
                }
            }
        }