void OnTriggerExit(Collider other) { // Skip check for other PhysicsCheckTypes if (ParentGrabber == null || PhysicsCheckType != RemoteGrabType.Trigger) { return; } 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; } }
void OnTriggerEnter(Collider other) { // Skip check for other PhysicsCheckTypes if (ParentGrabber == null || PhysicsCheckType != RemoteGrabType.Trigger) { return; } // Ignore Raycast Triggers if (other.gameObject.layer == 2) { return; } // We will let this grabber know we have remote objects available Grabbable grabObject = other.GetComponent <Grabbable>(); if (grabObject != null && ParentGrabber != null) { ParentGrabber.AddValidRemoteGrabbable(other, grabObject); return; } // Check for Grabbable Child Object Last GrabbableChild gc = other.GetComponent <GrabbableChild>(); if (gc != null && ParentGrabber != null) { ParentGrabber.AddValidRemoteGrabbable(other, gc.ParentGrabbable); return; } }
void OnTriggerExit(Collider other) { Grabbable g = other.GetComponent <Grabbable>(); if (g != null) { RemoveNearbyGrabbable(other, g); return; } GrabbableChild gc = other.GetComponent <GrabbableChild>(); if (gc != null) { RemoveNearbyGrabbable(other, gc.ParentGrabbable); return; } }
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; } }
void OnTriggerEnter(Collider other) { // Check for standard Grabbables first Grabbable g = other.GetComponent <Grabbable>(); if (g != null) { AddNearbyGrabbable(other, g); return; } // Check for Child Grabbables that reference a parent GrabbableChild gc = other.GetComponent <GrabbableChild>(); if (gc != null && gc.ParentGrabbable != null) { AddNearbyGrabbable(other, gc.ParentGrabbable); return; } }