예제 #1
0
    private bool HandlePause(bool mouseClick = false)
    {
        if (isTransitioning)
        {
            return(paused);
        }
        if (!paused)
        {
            if (cursor1.pause() || mouseClick)
            {
                hud.pausePresser = 1; paused = true; PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Pause);
            }
            else if (cursor2.pause())
            {
                hud.pausePresser = 2; paused = true; PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Pause);
            }
        }
        else
        {
            if (hud.pauseMenu == null)
            {
                return(paused);
            }
            switch (hud.pauseMenu.state)
            {
            case 1: PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Confirm); isTransitioning = true; PD.SaveAndQuit(hud.GetTimeInSeconds()); break;

            case 2: PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Confirm);
                isTransitioning = true;
                if (PD.gameType == PersistData.GT.Challenge)
                {
                    PD.LowerPuzzleLevel();
                    PD.SaveAndPuzzleSelect(hud.GetTimeInSeconds());
                }
                else
                {
                    PD.SaveAndMainMenu(hud.GetTimeInSeconds());
                }
                break;

            case 3: if (PD.gameType == PersistData.GT.Challenge)
                {
                    PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Confirm);
                    isTransitioning = true;
                    PD.SaveAndReset(hud.GetTimeInSeconds());
                }
                else
                {
                    PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Unpause);
                    paused = false;
                }
                break;

            case 4: paused = false; PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Unpause); break;
            }
        }
        return(paused);
    }
예제 #2
0
    protected bool HandlePause(bool mouseClick = false)
    {
        if (isTransitioning || (PD.gameType == PersistData.GT.Online && !PD.forceOnlinePause))
        {
            if (PD.gameType == PersistData.GT.Online && (cursor1.pause() || mouseClick))
            {
                pausePresses++;
                lastPausePress = Time.time;
                if (pausePresses > 3)
                {
                    PD.SaveAndMainMenu(hud.GetTimeInSeconds());
                }
            }
            return(paused);
        }
        if (!paused)
        {
            if (cursor1.pause() || mouseClick)
            {
                hud.pausePresser = 1; paused = true; PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Pause);
            }
            else if (cursor2.pause())
            {
                hud.pausePresser = 2; paused = true; PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Pause);
            }
        }
        else
        {
            Debug.Log("A");
            if (hud.pauseMenu == null)
            {
                Debug.Log("X"); return(paused);
            }
            Debug.Log(hud.pauseMenu.state);
            switch (hud.pauseMenu.state)
            {
            case 1: PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Confirm); isTransitioning = true; PD.SaveAndQuit(hud.GetTimeInSeconds()); break;

            case 2: PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Confirm);
                isTransitioning = true;
                if (PD.gameType == PersistData.GT.Challenge)
                {
                    PD.LowerPuzzleLevel();
                    PD.SaveAndPuzzleSelect(hud.GetTimeInSeconds());
                }
                else
                {
                    PD.SaveAndMainMenu(hud.GetTimeInSeconds());
                }
                break;

            case 3: if (PD.gameType == PersistData.GT.Challenge)
                {
                    PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Confirm);
                    isTransitioning = true;
                    PD.SaveAndReset(hud.GetTimeInSeconds());
                }
                else
                {
                    PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Unpause);
                    paused = false;
                }
                break;

            case 4: paused = false; PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Unpause); break;
            }
        }
        return(paused);
    }