Пример #1
0
    //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    //                                                                                                                        HandlePause()
    //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    private void HandlePause()
    {
        if (Input.GetKeyDown(Key.P) && gameIsPaused == false)
        {
            Globals.showMouseCursor = true;

            if (level1IsActive == true)
            {
                _level1.Pause();
                pauseMusic();
                gameIsPaused       = true;
                pause_menu.visible = true;
            }

            if (level2IsActive == true)
            {
                _level2.Pause();
                pauseMusic();
                gameIsPaused       = true;
                pause_menu.visible = true;
            }

            if (Globals.levelBossIsActive == true)
            {
                _levelBoss.Pause();
                pauseMusic();
                gameIsPaused       = true;
                pause_menu.visible = true;
            }
        }
    }