예제 #1
0
 void FixedUpdate()
 {
     if (MoveBase.IsGrounded(heightBelowWhichToApplyHoverForce, groundMask))
     {
         Hover();
     }
     else if (!MoveBase.IsGrounded(heightAboveWhichToGlide, groundMask))
     {
         SwitchToGlide();
     }
     //characterMotor.RotateToVelocity(rotateSpeed, minYrotation, maxYrotation, yMultiplier);
     characterMotor.ManageSpeed(tooFastDecelSpeed, maxSpeed, false);
 }
예제 #2
0
    void CalculateGroundedState()
    {
        var tempGroundedState = currentlyGrounded;

        currentlyGrounded = InCloud ? InCloud : MoveBase.IsGrounded(MoveBase.col.bounds.extents.y, groundMask);
        if (!currentlyGrounded && tempGroundedState)
        {
            EnactJumpLeniency();
        }
        if (currentlyGrounded && !canReleaseToResetVelocity)
        {
            canReleaseToResetVelocity = true;
        }
    }
예제 #3
0
 void Glide()
 {
     if (!MoveBase.IsGrounded(MinimumHeightToGlideAbove, groundMask))
     {
         characterMotor.SetVelocity(transform.forward * glideSpeed);
         characterMotor.MoveRelativeToGround(groundRepelForce * Vector3.down);
     }
     else if (MoveBase.playerAbilities.hoveringUnlocked)
     {
         MoveBase.movementStateMachine.HoverMovement();
     }
     else
     {
         MoveBase.movementStateMachine.NormalMovement();
     }
 }