Пример #1
0
        internal static InputEventRegisterInfo <InputUIOnMouseEvent> GetOnMouseListener(string m_UIEventKey, string UIName, string ComponentName, bool isDown, InputEventHandle <InputUIOnMouseEvent> callback)
        {
            InputEventRegisterInfo <InputUIOnMouseEvent> info = HeapObjectPool <InputEventRegisterInfo <InputUIOnMouseEvent> > .GetObject();

            info.eventKey = InputUIOnMouseEvent.GetEventKey(UIName, ComponentName, isDown);
            info.callBack = callback;

            InputMessageManager.AddListener(
                InputUIOnMouseEvent.GetEventKey(UIName, ComponentName, isDown), callback);

            return(info);
        }
Пример #2
0
        public static void DispatchMouseEvent(string UIName, string ComponentName, bool isDown, string parm)
        {
            //只有允许输入时才派发事件
            if (IsActive)
            {
                InputUIOnMouseEvent e = GetUIEvent <InputUIOnMouseEvent>(UIName, ComponentName, parm);
                e.m_isDown = isDown;
                e.m_type   = isDown? InputUIEventType.PressDown:InputUIEventType.PressUp;

                InputMessageManager.Dispatch("InputUIOnMouseEvent", e);
            }
        }