Example #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);
        }
Example #2
0
        void OnMouseEvent(string eventType, IMouseCtrl tar, Vector2 screenPoint, Vector3 worldPoint, int mouse)
        {
            //Debug.Log("eventType : " + eventType + "   tar : " + tar);
            //Debug.Log("tar : " + tar);
            //Debug.Log("screenPoint : " + screenPoint);
            //Debug.Log("worldPoint : " + worldPoint);

            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);
            Message    msg = new Message(MsgType.Com_MouseEvent, this);

            msg["event"] = me;
            msg.Send();
        }