Exemplo n.º 1
0
    protected virtual void ApplyButtonUIEvents()
    {
        Button v_button = GetComponent <Button>();

        if (v_button != null)
        {
            RemoveListener(v_button.onClick, FullSend);
            if (UITrigger.ContainsFlag(UITriggerEnum.OnPointerClick))
            {
                AddListener(v_button.onClick, FullSend);
            }
        }
    }
Exemplo n.º 2
0
    protected virtual void ApplyTriggerUIEvents()
    {
        EventTrigger v_eventTrigger = GetComponent <EventTrigger>();

        if (v_eventTrigger != null)
        {
            //Remove Listeners Before Add
            foreach (EventTrigger.Entry v_entry in v_eventTrigger.triggers)
            {
                if (v_entry != null && v_entry.callback != null)
                {
                    v_entry.callback.RemoveListener(CallFullSendWithEventData);
                }
            }

            if (UITrigger.ContainsFlag(UITriggerEnum.OnPointerEnter))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.PointerEnter);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnPointerExit))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.PointerExit);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnPointerDown))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.PointerDown);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnPointerUp))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.PointerUp);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnPointerClick))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.PointerClick);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnDrag))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.Drag);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnDrop))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.Drop);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnScroll))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.Scroll);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnUpdateSelected))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.UpdateSelected);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnSelect))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.Select);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnDeselect))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.Deselect);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnMove))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.Move);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnInitializePotentialDrag))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.InitializePotentialDrag);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnBeginDrag))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.BeginDrag);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnEndDrag))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.EndDrag);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnSubmit))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.Submit);
            }
            if (UITrigger.ContainsFlag(UITriggerEnum.OnCancel))
            {
                AddReplacingEntry(v_eventTrigger, EventTriggerType.Cancel);
            }
        }
    }