Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
        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;
            }
        }
Exemplo n.º 4
0
        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;
            }
        }
Exemplo n.º 5
0
        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;
            }
        }