示例#1
0
 /// <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;
 }
示例#2
0
 /// <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;
 }