コード例 #1
0
    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);
        }
    }
コード例 #2
0
    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;
        }
    }