Beispiel #1
0
        protected virtual void OnTriggerExit(Collider other)
        {
            if (!CheckObject(other.gameObject))
            {
                return;
            }

            Reset();

            TrackedHand script = other.gameObject.GetComponent <TrackedHand>();

            if (script != null)
            {
                script.Unsubscribe(this);
            }
        }
        protected virtual bool OnTriggerExit(Collider other)
        {
            if (!checkCollider(other))
            {
                return(false);
            }

            Reset();

            TrackedHand script = other.gameObject.GetComponent <TrackedHand>();

            if (script != null)
            {
                script.Unsubscribe(this);
            }

            return(true);
        }
        protected virtual void OnTriggerEnter(Collider other)
        {
            if (!checkCollider(other))
            {
                return;
            }

            //save maxDistance
            maxDistance = getDistanceToPoint(other.transform.position);

            TrackedHand script = other.gameObject.GetComponent <TrackedHand>();

            if (script != null)
            {
                script.Subscribe(this);
            }

            trackedObject = other.gameObject;
        }
Beispiel #4
0
        protected virtual bool OnTriggerEnter(Collider other)
        {
            if (!checkCollider(other) ||
                trackingObject)
            {
                return(false);
            }

            trackingObject = other.gameObject;

            TrackedHand script = other.GetComponent <TrackedHand>();

            tracking = true;

            if (script)
            {
                script.Subscribe(this);
            }
            return(true);
        }
Beispiel #5
0
        protected virtual bool OnTriggerEnter(Collider other)
        {
            if (!CheckObject(other.gameObject))
            {
                return(false);
            }

            trackedObject = other.gameObject;

            //save maxDistance
            maxDistance = getDistanceToPoint(other.transform.position);
            maxDistance = Mathf.Abs(maxDistance);

            TrackedHand script = other.gameObject.GetComponent <TrackedHand>();

            if (script != null)
            {
                script.Subscribe(this);
            }

            return(true);
        }