/// <summary> /// Throw the current grabbed object. /// </summary> /// <param name="linearVelocity">Linear velocity of the throw.</param> /// <param name="angularVelocity">Angular velocity of the throw.</param> protected void ReleaseGrabbedObject(Vector3 linearVelocity, Vector3 angularVelocity) { _timeSinceLastRelease = Time.timeSinceLevelLoad; GrabbedObject.GrabEnd(this, linearVelocity, angularVelocity); OnGrabEnded?.Invoke(GrabbedObject?.gameObject); OnGrabTimedEnded?.Invoke(GrabbedObject?.gameObject, (_timeSinceLastRelease - _timeSinceLastGrab) ?? 0f); GrabbedObject = null; }
/// <summary> /// Throw the current grabbed object. /// </summary> /// <param name="linearVelocity">Linear velocity of the throw.</param> /// <param name="angularVelocity">Angular velocity of the throw.</param> protected void ReleaseGrabbedObject(Vector3 linearVelocity, Vector3 angularVelocity) { GrabbedObject.GrabEnd(this, linearVelocity, angularVelocity); OnGrabEnded?.Invoke(GrabbedObject?.gameObject); GrabbedObject = null; }