public static float CalculateJumpVelocity(float desiredJumpHeigth) { return(Mover.CalculateJumpVelocity( desiredJumpHeigth, -Physics.gravity.magnitude )); }
void OnEnable() { if (this.Subject == null) { if (this.TryGetComponent(out Rigidbody gameObjectRB)) { Debug.LogWarning($"{this.name}: taking RB of gameObject!"); this.Subject = gameObjectRB; } else { Debug.LogError($"{this.name}: can't find rigidbody!"); } } this._jumpVelocity = Mover.CalculateJumpVelocity(this.JumpHeight) * (-Physics.gravity.normalized); }