コード例 #1
0
        void OnTriggerExit(Collider other)
        {
            Grabbable grabObject = other.GetComponent <Grabbable>();

            if (grabObject != null && ParentGrabber != null)
            {
                ParentGrabber.RemoveValidRemoteGrabbable(other, grabObject);
            }
        }
コード例 #2
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;
            }
        }
コード例 #3
0
        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;
        }