Ejemplo n.º 1
0
        public static ASEventTrigger Get(GameObject go)
        {
            ASEventTrigger listener = go.GetComponent <ASEventTrigger>();

            if (listener == null)
            {
                listener = go.AddComponent <ASEventTrigger>();
            }
            return(listener);
        }
Ejemplo n.º 2
0
        protected virtual void bindAutoClick(bool value)
        {
            if (_skin == null)
            {
                return;
            }
            ASEventTrigger trriger = EventDispatcher.Get(_skin);

            trriger.mouseEnterEnabled = value;
            if (value)
            {
                _button.onClick.RemoveListener(clickHandle);
                trriger.addEventListener(MouseEventX.MOUSE_DOWN, mouseEventHandle);
                trriger.addEventListener(MouseEventX.MOUSE_ENTER, mouseEventHandle);
                trriger.addEventListener(MouseEventX.MOUSE_UP, mouseEventHandle);
            }
            else
            {
                _button.onClick.AddListener(clickHandle);
                trriger.removeEventListener(MouseEventX.MOUSE_DOWN, mouseEventHandle);
                trriger.removeEventListener(MouseEventX.MOUSE_ENTER, mouseEventHandle);
                trriger.removeEventListener(MouseEventX.MOUSE_UP, mouseEventHandle);
            }
        }