Beispiel #1
0
 void UpdateVisualDefense()
 {
     //defenseVisual.SetActive(isDefendingRight || isDefendingLeft);
     if (isDefendingLeft || isDefendingRight)
     {
         spritesheet.PlayAnimation("Defend", true);
     }
     else
     {
         spritesheet.PlayAnimation("Idle", true);
     }
 }
Beispiel #2
0
    void MoveLeft()
    {
        if (isRunning == false || canPunch == false)
        {
            return;
        }

        if (position > 0)
        {
            if (position - 1 == punchBag)
            {
                Crash();
            }
            else
            {
                position--;
                UpdatePosition();
            }

            FlipPlayerLeft();
        }

        spritesheet.PlayAnimation("Idle", true);
    }