public void OnPointerUp(PointerEventData eventData) { if (dragCoroutine != null) { StopCoroutine(dragCoroutine); } OnGrabEnd?.Invoke(dragAnchor); dragAnchor = null; }
private void EndGrab() { SetHandPose(_grabbed.GrabPoseID, false); if (_grabbed.GrabbedBySecond == this) { // This is the second hand being released. Clear second grab from the first's joint _grabbed.GrabbedBy.SetSecondGrab(null, null); } else if (_grabbed.GrabbedBySecond != null) { // This is the first hand being released. The second must now use its own joint to grab _grabbed.GrabbedBySecond.SetGrab(_grabbed.Body, _attacher.SecondAnchor); } var grabbed = _grabbed; _grabbed = null; grabbed.Release(this); SetGrab(null, null); SetSecondGrab(null, null); _solidHandMover.Anchor = null; OnGrabEnd?.Invoke(grabbed); }