Ejemplo n.º 1
0
        public static T GetEvent <T>(string eventKey) where T : IInputEventBase, new()
        {
            T tmp = HeapObjectPool <T> .GetObject();

            tmp.EventKey = eventKey;

            return(tmp);
        }
Ejemplo n.º 2
0
        static T GetUIEvent <T>(string UIName, string ComponentName, string parm) where T : InputUIEventBase, new()
        {
            T msg = HeapObjectPool <T> .GetObject();

            msg.Reset();
            msg.m_name     = UIName;
            msg.m_compName = ComponentName;
            msg.m_pram     = parm;

            return(msg);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        public static InputEventRegisterInfo <InputUILongPressEvent> GetLongPressListener(LongPressAcceptor acceptor, string UIName, string ComponentName, string parm, InputEventHandle <InputUILongPressEvent> callback)
        {
            InputlongPressRegisterInfo info = HeapObjectPool <InputlongPressRegisterInfo> .GetObject();

            info.eventKey      = InputUILongPressEvent.GetEventKey(UIName, ComponentName, parm);
            info.callBack      = callback;
            info.m_acceptor    = acceptor;
            info.m_OnLongPress = (type) =>
            {
                DispatchLongPressEvent(UIName, ComponentName, parm, type);
            };

            return(info);
        }
Ejemplo n.º 6
0
        public static InputEndDragRegisterInfo GetOnEndDragListener(DragAcceptor acceptor, string UIName, string ComponentName, string parm, InputEventHandle <InputUIOnEndDragEvent> callback)
        {
            InputEndDragRegisterInfo info = HeapObjectPool <InputEndDragRegisterInfo> .GetObject();

            info.eventKey    = InputUIOnEndDragEvent.GetEventKey(UIName, ComponentName, parm);
            info.callBack    = callback;
            info.m_acceptor  = acceptor;
            info.m_OnEndDrag = (data) =>
            {
                DispatchEndDragEvent(UIName, ComponentName, parm, data);
            };

            return(info);
        }
Ejemplo n.º 7
0
        public static InputButtonClickRegisterInfo GetOnClickListener(Button button, string UIName, string ComponentName, string parm, InputEventHandle <InputUIOnClickEvent> callback)
        {
            InputButtonClickRegisterInfo info = HeapObjectPool <InputButtonClickRegisterInfo> .GetObject();

            info.eventKey  = InputUIOnClickEvent.GetEventKey(UIName, ComponentName, parm);
            info.callBack  = callback;
            info.m_button  = button;
            info.m_OnClick = () =>
            {
                DispatchOnClickEvent(UIName, ComponentName, parm);
            };

            return(info);
        }
Ejemplo n.º 8
0
 public static void PutSODict(Dictionary <string, object> dict)
 {
     dict.Clear();
     HeapObjectPool <Dictionary <string, object> > .PutObject(dict);
 }
Ejemplo n.º 9
0
 public static Dictionary <string, object> GetSODict()
 {
     return(HeapObjectPool <Dictionary <string, object> > .GetObject());
 }