예제 #1
0
 void Jump()
 {
     CurrentLedge = null;
     OnJump.SafeInvoke();
     PhysicsState.SetVerticalVelocity(_jumpPower[MaxJumpCount - JumpCount]);
     CmdJump();
 }
예제 #2
0
        public void Jump()
        {
            if (Restricted)
            {
                return;
            }

            float g = _gravity == null ? _gravity.Gravity : defaultGravity;

            // Apply upward force to jump
            Vector3 temp = Character.Velocity;

            temp.y             = Mathf.Sqrt(2 * g * _jumpHeights[JumpCount]);
            Character.Velocity = temp;

            JumpCount++;

            // Trigger animation
            Animator.SetTrigger(_jumpTrigger);

            OnJump.SafeInvoke();
        }
예제 #3
0
 public virtual void Jump()
 {
     OnJump.SafeInvoke();
 }