Exemplo n.º 1
0
    public void TutorialPunch()
    {
        if (state == TutorialState.Playing && !punchedTut)
        {
            touch.ConsumeAllInput();

            player.enabled = true;
            punchedTut     = true;
            swipeTutText.SetActive(true);
            Pause();
            state = TutorialState.Punch;
        }
    }
Exemplo n.º 2
0
    private void Update()
    {
        if (GameController.controller.IsPaused())
        {
            return;
        }

        bool dodgeLeftInput  = touch.getLeftTap;
        bool dodgeRightInput = touch.getRightTap;
        bool punchInput      = touch.getCenterTap;

        if (state == PlayerState.Idle)
        {
            // Dodge Mechanics
            if (canDodge)
            {
                if (dodgeLeftInput || queuedPlayerAction == PlayerAction.DodgeLeft)
                {
                    DoLeftDodge();
                }

                if (dodgeRightInput || queuedPlayerAction == PlayerAction.DodgeRight)
                {
                    DoRightDodge();
                }
            }
        }

        if (state == PlayerState.Punch)
        {
            if (punchInput)
            {
                queuedPlayerAction = PlayerAction.Punch;
            }
        }

        if (state == PlayerState.Idle || state == PlayerState.Punch)
        {
            if (canPunch && !attacking)
            {
                // Punch
                if (punchInput || queuedPlayerAction == PlayerAction.Punch)
                {
                    DoPunch();
                }
            }
        }

        if (!tutorialMode)
        {
            // Let tutorial consume if in tutorial mode.
            touch.ConsumeAllInput();
        }
    }