Play() публичный Метод

public Play ( int id ) : void
id int
Результат void
Пример #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;
        }
    }
Пример #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");
     }
 }
Пример #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;
        }
    }