예제 #1
0
    private void GroundCheck()
    {
        isGrounded = Physics2D.OverlapCircle(transform.posVector2() + groundCheckOffset, groundCheckRadius, whatIsGround);

        if (!isGrounded && !stateController.IsCurrentStateInRange(State.Appear, State.Disappear))
        {
            if (!stateController.IsCurrentState(State.Jump))
            {
                stateController.SetState(State.Jump);
            }
            stateController.SetVertSpeedInfo(playerBody.velocity.y);
        }
        else if (isGrounded)
        {
            isJumpAvailable = true;
        }
    }