Play() public method

public Play ( int id ) : void
id int
return void
Ejemplo n.º 1
0
    void FixedUpdate()
    {
        if (isJumping)
        {
            FixedUpdateJump();

            if (!isSurfing)
            {
                if (Random.Range(0, 20) < 15)
                {
                    m_Animations.Play(PlayerAnimation.PlayerStates.Jump);
                }
                else
                {
                    m_Animations.Play(PlayerAnimation.PlayerStates.Jump2);
                }
            }
            else
            {
                m_Animations.Play(PlayerAnimation.PlayerStates.Jump);
            }
            //Debug.Log("Jumping");
            isJumping = false;
        }
        if (isFallingDown)
        {
            ChangeGravity();
            DownForce();

            isFallingDown = false;
        }
    }
Ejemplo n.º 2
0
 void PlayWalkAnimation(Vector2 velocity)
 {
     if (Mathf.Abs(velocity.x) > 0)
     {
         _playerAnimation.Play("SideWalk");
     }
     else if (velocity.y > 0)
     {
         _playerAnimation.Play("UpwardWalk");
     }
     else if (velocity.y < 0)
     {
         _playerAnimation.Play("DownwardWalk");
     }
     else
     {
         _playerAnimation.Play("Idle");
     }
 }
Ejemplo n.º 3
0
    void KeyDownAction(KeyCode key)
    {
        switch (key)
        {
        case KeyCode.A:
        case KeyCode.D:
            playerAnimation.Play("IsRun", true);
            break;

        case KeyCode.Space:
            playerAnimation.Play("IsJump", true);
            if (isGrounded)
            {
                playerJump.Jump(jumpPower);
            }
            break;

        case KeyCode.F:
            int dir = direction.Direction == EDirection.LEFT ? -1 : 1;
            playerFlash.FlashMove(dir, moveSpeed);
            break;
        }
    }