Пример #1
0
        /// <summary>
        /// 绑定显示项事件
        /// </summary>
        /// <param name="item">显示项</param>
        void bindDisplayItemEvent(DisplayItem item)
        {
            if (trigger == null)
            {
                return;
            }
            if (item.isNoneTrigger())
            {
                return;
            }
            UnityAction <BaseEventData> func = (_) => refreshKey(item);

            switch (item.trigger)
            {
            case DisplayItem.Trigger.Click:
                addTriggerEvent(EventTriggerType.PointerClick, func); break;

            case DisplayItem.Trigger.Hover:
                addTriggerEvent(EventTriggerType.PointerEnter, func); break;

            case DisplayItem.Trigger.HOC:
                addTriggerEvent(EventTriggerType.PointerClick, func);
                addTriggerEvent(EventTriggerType.PointerEnter, func);
                break;
            }
        }