private void OnObjectInBeamDisabled(GameObject obj) { ObjectsInBeam.Remove(obj); if (ObjectsInBeam.Count == 0) { SetLaserPointerCol(laserPointerNoItemsCol); } }
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; } }