Пример #1
0
        void OnMouseEvent(string eventType, IMouseCtrl tar, Vector2 screenPoint, Vector3 worldPoint, int mouse)
        {
            switch (eventType)
            {
            case MouseEvent.MouseDown:
                if (tar != null)
                {
                    tar.MouseDown(screenPoint, worldPoint, mouse);
                }
                break;

            case MouseEvent.MouseUp:
                if (tar != null)
                {
                    tar.MouseUp(screenPoint, worldPoint, mouse);
                }
                break;

            case MouseEvent.OnDragStart:
                if (tar != null)
                {
                    tar.OnDragStart(screenPoint, worldPoint, mouse);
                }
                break;

            case MouseEvent.OnDraging:
                if (curMC != null)
                {
                    curMC.OnDraging(screenPoint, worldPoint, mouse);
                }
                break;

            case MouseEvent.OnDragEnd:
                if (curMC != null)
                {
                    curMC.OnDragEnd(screenPoint, worldPoint, mouse);
                }
                break;

            case MouseEvent.OnMouseClick:
                if (tar != null)
                {
                    tar.MouseClick(screenPoint, worldPoint, mouse);
                }
                break;

            case MouseEvent.OnMouseDoubleClick:
                if (tar != null)
                {
                    tar.MouseDoubleClick(screenPoint, worldPoint, mouse);
                }
                break;
            }

            MouseEvent me = new MouseEvent(eventType, tar, screenPoint, worldPoint, mouse);

            MiniEventManager.TriggerEvent(me);
        }
Пример #2
0
 public static void MiniEventStopListening <EventType>(this MiniEventListener <EventType> caller) where EventType : struct
 {
     MiniEventManager.RemoveListener <EventType>(caller);
 }