Example #1
0
 /// <summary>
 /// 움직이기
 /// </summary>
 private void Move()
 {
     if (!ignoreMoveForce)
     {
         if (playerInput.move > 0)
         {
             playerAnimCtrl.SetFlipX(false);
         }
         else if (playerInput.move < 0)
         {
             playerAnimCtrl.SetFlipX(true);
         }
         else
         {
             playerAnimCtrl.PlayAnim(PlayerAnimCtrl.AnimKind.Run, false, 1f);
             return;
         }
         Vector2 movePos = playerInput.move * Vector2.right * runSpeed * Time.fixedDeltaTime;
         playerRigidbody.position = playerRigidbody.position + movePos;
         playerAnimCtrl.PlayAnim(PlayerAnimCtrl.AnimKind.Run, true, playerInput.move * 5f);
     }
     else if (ignoreMoveForce && Common.GameState != GameState.End)
     {
         playerAnimCtrl.PlayAnim(PlayerAnimCtrl.AnimKind.Run, false, 1f);
     }
 }