public static void DispatchScrollEvent(string UIName, string ComponentName, string parm, Vector2 position)
 {
     //只有允许输入时才派发事件
     if (IsActive)
     {
         InputUIOnScrollEvent e = GetOnScrollEvent(UIName, ComponentName, parm, position);
         InputMessageManager.Dispatch("InputUIOnScrollEvent", e);
     }
 }
        //public static void DispatchUIEvent<T>(string UIName, string ComponentName, string parm) where T : InputUIEventBase, new()
        //{
        //    //只有允许输入时才派发事件
        //    if (IsActive)
        //    {
        //        T eventTmp = GetUIEvent<T>(UIName, ComponentName, parm);
        //        InputManager.Dispatch<T>(eventTmp);
        //    }
        //}

        public static void DispatchOnClickEvent(string UIName, string ComponentName, string parm)
        {
            //只有允许输入时才派发事件
            if (IsActive)
            {
                InputUIOnClickEvent e = GetUIEvent <InputUIOnClickEvent>(UIName, ComponentName, parm);
                InputMessageManager.Dispatch("InputUIOnClickEvent", e);
            }
        }
 public static void DispatchEndDragEvent(string UIName, string ComponentName, string parm, PointerEventData data)
 {
     //只有允许输入时才派发事件
     if (IsActive)
     {
         InputUIOnEndDragEvent e = GetUIEvent <InputUIOnEndDragEvent>(UIName, ComponentName, parm);
         e.m_dragPosition = data.position;
         e.m_delta        = data.delta;
         InputMessageManager.Dispatch("InputUIOnEndDragEvent", e);
     }
 }
        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);
        }
        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);
            }
        }
        public static InputEventRegisterInfo <InputUIOnScrollEvent> GetOnScrollListener(string UIName, string ComponentName, InputEventHandle <InputUIOnScrollEvent> callback)
        {
            InputEventRegisterInfo <InputUIOnScrollEvent> info = HeapObjectPool <InputEventRegisterInfo <InputUIOnScrollEvent> > .GetObject();

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

            InputMessageManager.AddListener(
                InputUIOnScrollEvent.GetEventKey(UIName, ComponentName), callback);

            return(info);
        }
        public static void DispatchLongPressEvent(string UIName, string ComponentName, string parm, InputUIEventType type)
        {
            //只有允许输入时才派发事件
            if (IsActive)
            {
                InputUILongPressEvent e = GetUIEvent <InputUILongPressEvent>(UIName, ComponentName, parm);
                e.m_type = type;
                //e.m_LongPressType = type;

                e.EventKey = InputUILongPressEvent.GetEventKey(UIName, ComponentName, parm);
                InputMessageManager.Dispatch("InputUILongPressEvent", e);
            }
        }