public override void OnEnter() { base.OnEnter(); InteractiveZoneController componentInParent = base.Owner.GetComponentInParent <InteractiveZoneController>(); if (componentInParent != null && componentInParent.Dispatcher != null) { eventChannel = new EventChannel(componentInParent.Dispatcher); componentInParent.Dispatcher.AddListener <InteractionZoneEvents.IteractiveItemCountEvent>(OnInteractiveItemCountChanged); } }
public void OnTriggerExit(Collider other) { InteractiveZoneController componentInParent = other.GetComponentInParent <InteractiveZoneController>(); if (componentInParent != null) { if (dispatcher != null) { dispatcher.DispatchEvent(new InteractionZoneEvents.InteractivePropEquipEvent(ItemType, InteractiveItemAction.UnEquip)); } dispatcher = null; } }