예제 #1
0
        /// <summary>
        /// 交互输入响应处理
        /// </summary>
        private void DispatchTrigger(PointerEventData eventData)
        {
            bool triggerDown = false;
            bool triggerUp   = false;

            InputManager.InputUpdate(out triggerDown, out triggerUp);

            ProcessPress(eventData, triggerDown, triggerUp);
            ProcessMove(eventData);

            if (EnabledDrag)
            {
                ProcessDrag(eventData);
            }

            GameObject interactiveObj = GetInteractiveObj(eventData.pointerCurrentRaycast.gameObject);

            if (triggerDown)
            {
                SuperPointerListener.InvokePointerDown(eventData.pointerCurrentRaycast, interactiveObj);
            }

            if (triggerUp)
            {
                SuperPointerListener.InvokePointerUp(eventData.pointerCurrentRaycast, interactiveObj);
            }
        }
예제 #2
0
        /// <summary>
        /// 指针悬浮处理
        /// </summary>
        private void DispatchPointerHover(PointerEventData eventData, GameObject prevObject)
        {
            GameObject curObject = eventData.pointerCurrentRaycast.gameObject;

            GameObject interactiveObj = GetInteractiveObj(curObject);

            if (curObject != null && curObject == prevObject)
            {
                SuperPointerListener.InvokePointerHover(eventData.pointerCurrentRaycast, interactiveObj);
            }
            else
            {
                if (prevObject != null)
                {
                    SuperPointerListener.InvokePointerExit(prevObject);
                }

                if (curObject != null)
                {
                    SuperPointerListener.InvokePointerEnter(eventData.pointerCurrentRaycast, interactiveObj);
                }
            }
        }