Пример #1
0
    private void selectMenuOption(SwipeControls.DIRECTION direction)
    {
        //A check whether the option has changed or not
        optionChanged = true;

        if (direction == SwipeControls.DIRECTION.LEFT || Input.GetKeyDown(KeyCode.A))
        {
            if ((int)menuSelect == 0)
            {
                menuSelect = MENUSELECT.EXIT;
            }
            else
            {
                menuSelect--;
            }
        }

        else if (direction == SwipeControls.DIRECTION.RIGHT || Input.GetKeyDown(KeyCode.D))
        {
            if ((int)menuSelect == 3)
            {
                menuSelect = MENUSELECT.START;
            }
            else
            {
                menuSelect++;
            }
        }
    }
Пример #2
0
    private void onTap(MENUSELECT menu)
    {
        if (menu == MENUSELECT.START)
        {
            _menuSounds.stopSound();
            goToGame();
        }

        else if (menu == MENUSELECT.EXIT)
        {
            _menuSounds.stopSound();
            exitGame();
        }
    }
Пример #3
0
 private void playSwitchSound(MENUSELECT direction)
 {
     _menuSounds.playSound((int)direction + 1);
 }