void OnTriggerExit(Collider other) { Grabbable grabObject = other.GetComponent <Grabbable>(); if (grabObject != null && ParentGrabber != null) { ParentGrabber.RemoveValidRemoteGrabbable(other, grabObject); } }
void OnTriggerExit(Collider other) { Grabbable grabObject = other.GetComponent <Grabbable>(); if (grabObject != null && ParentGrabber != null) { ParentGrabber.RemoveValidRemoteGrabbable(other, grabObject); return; } // Check for Grabbable Child Object Last GrabbableChild gc = other.GetComponent <GrabbableChild>(); if (gc != null && ParentGrabber != null) { ParentGrabber.RemoveValidRemoteGrabbable(other, gc.ParentGrabbable); return; } }
public void RemovePreviousHitObject() { if (_lastColliderHit == null) { return; } if (_lastColliderHit.TryGetComponent(out Grabbable grabObject)) { ParentGrabber.RemoveValidRemoteGrabbable(_lastColliderHit, grabObject); return; } // Check for Grabbable Child Object Last if (_lastColliderHit.TryGetComponent(out GrabbableChild gc)) { ParentGrabber.RemoveValidRemoteGrabbable(_lastColliderHit, gc.ParentGrabbable); return; } _lastColliderHit = null; }