private void Jump()
 {
     //앉은 상태에서 점프시 앉은 상태 해제
     if (isCrouch)
         Crouch();
     theStatusController.DecreaseStamina(100);
     myRigid.velocity = transform.up * jumpForce;
 }
 // Jump Act
 private void Jump()
 {
     // crouch and jump : no crouch
     if (isCrouch)
     {
         Crouch();
     }
     theStatusController.DecreaseStamina(100);
     myRigid.velocity = transform.up * jumpForce;
 }
    private void Jump()
    {
        if (isCrouch)
        {
            Crouch();
        }

        theStatusController.DecreaseStamina(100);

        myRigid.velocity = Vector3.up * jumpForce;
    }
Esempio n. 4
0
    private void Jump()
    {
        if (isCrouch) // 앉은상태에서 점프시도시 일어서게 만듬
        {
            Crouch();
        }

        theStatusController.DecreaseStamina(100); // 점프시 스테미너 100감소

        myRigid.velocity = transform.up * jumpForce;
    }
Esempio n. 5
0
    //점프
    private void Jump()
    {
        //앉아있는 상태에서 점프를 하면 앉은상태는 해제되도록 설정.
        if (isCrouch)
        {
            Crouch();
        }

        theStatusController.DecreaseStamina(100); //스태미나 감소

        myRigid.velocity = transform.up * jumpForce;
    }
 void TryJump()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         if (isGrounded && theStatusController.getCurrentSp() > 0)
         {
             rigid.velocity = transform.up * jumpForce;
             isGrounded     = false;
             theStatusController.DecreaseStamina(50);
         }
         //뛸때 크로스헤어 변하는 로직 구현하기
     }
 }
    private void CharacterMove()
    {
        if (Input.GetKey(KeyCode.LeftShift) && theStatusController.GetCurrentSP() > 0)
        {
            runCheck   = true;
            walk_speed = 7;
            theStatusController.DecreaseStamina(5);
        }
        else
        {
            runCheck   = false;
            walk_speed = 2;
        }
        if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.A))
        {
            if (Input.GetKey(KeyCode.W))
            {
                transform.Translate(Vector2.up * walk_speed * Time.deltaTime);
                moveCheck = true;
            }
            if (Input.GetKey(KeyCode.S))
            {
                transform.Translate(Vector2.down * walk_speed * Time.deltaTime);
                moveCheck = true;
            }
            if (Input.GetKey(KeyCode.D))
            {
                transform.Translate(Vector2.right * walk_speed * Time.deltaTime);
                moveCheck = true;
            }
            if (Input.GetKey(KeyCode.A))
            {
                transform.Translate(Vector2.left * walk_speed * Time.deltaTime);
                moveCheck = true;
            }
        }
        else
        {
            moveCheck = false;
        }

        if (Input.GetAxisRaw("Horizontal") != 0 || Input.GetAxisRaw("Vertical") != 0)
        {
            anim.SetFloat("MoveX", Input.GetAxisRaw("Horizontal"));
            anim.SetFloat("MoveY", Input.GetAxisRaw("Vertical"));
        }
    }
 private void Running()
 {
     isRun = true;
     theStatusController.DecreaseStamina(10f * Time.deltaTime);
     applySpeed = runSpeed;
 }