Пример #1
0
    // 根据速度移动
    void DoMove()
    {
        if (isClimbingLadder)
        {
            return;
        }

        if (playerStateManager.isJump)
        {
            return;
        }

        rigi.velocity = new Vector2(horizontalSpeed, rigi.velocity.y);
        // 修改运动状态标识
        if (Math.Abs(horizontalSpeed) > runSpeed)
        {
            playerStateManager.Dash();
        }
        else if (Math.Abs(horizontalSpeed) > 0)
        {
            if (!Input.GetKey(KeyCode.I))
            {
                canDash = true;
            }
            playerStateManager.Run();
        }
    }
Пример #2
0
 // 根据速度移动
 void DoMove()
 {
     if (!playerStateManager.isAttack)
     {
         rigi.velocity = new Vector2(horizontalSpeed, rigi.velocity.y);
         // 修改运动状态标识
         if (Math.Abs(horizontalSpeed) > runSpeed)
         {
             playerStateManager.Dash();
         }
         else if (Math.Abs(horizontalSpeed) > 0)
         {
             playerStateManager.Run();
         }
     }
 }