void Jump() { CurrentLedge = null; OnJump.SafeInvoke(); PhysicsState.SetVerticalVelocity(_jumpPower[MaxJumpCount - JumpCount]); CmdJump(); }
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(); }
public virtual void Jump() { OnJump.SafeInvoke(); }