Beispiel #1
0
 private void FixedUpdate()
 {
     if (!_ground.IsGrounded() || !_ground.IsUpright())
     {
         return;
     }
     if (_direction.CheckCollision() && _direction.CheckFloor(ForwardJump, MaxFall, MaxJump))
     {
         if (IsJumpOnCooldown())
         {
             return;
         }
         _direction.UpdateBody();
         Jump();
         _lastJump = Time.time;
     }
     else
     {
         _direction.ChangeDirection(TurnAmount);
     }
 }