Example #1
0
        private void OnTriggerEnter(Collider other)
        {
            ObjectsInBeam.Add(other.gameObject);
            SetLaserPointerCol(laserPointerItemsCol);

            NotifyOnDisable disableNotifier = other.gameObject.GetComponent <NotifyOnDisable>();

            if (disableNotifier != null)
            {
                disableNotifier.OnObjectDisabled += OnObjectInBeamDisabled;
            }
        }
Example #2
0
        private void OnTriggerExit(Collider other)
        {
            ObjectsInBeam.Remove(other.gameObject);

            if (ObjectsInBeam.Count == 0)
            {
                SetLaserPointerCol(laserPointerNoItemsCol);
            }

            NotifyOnDisable disableNotifier = other.gameObject.GetComponent <NotifyOnDisable>();

            if (disableNotifier != null)
            {
                disableNotifier.OnObjectDisabled -= OnObjectInBeamDisabled;
            }
        }