SceneView, EditorWindow and no MouseUp events

1,742 views
Skip to first unread message

John Grden

unread,
Jun 2, 2011, 7:49:42 PM6/2/11
to unity3d-d...@googlegroups.com
hey has anyone found a solution where we can get MouseUp events in the OnSceneGUI calls within an EditorWindow?

The delegate gets called and I can see MouseMove, MouseDown but no MouseUp events.  I'd seen a post in a search whereby someone said that MouseUp wasn't dispatched unless you were releasing an handle of a tool on the scene. 

Is there a way around this or another solution I can use?

Thanks in advance - John

    static void Init ()
    {
        // Get existing open window or if none, make a new one:
        MyWindow window = (MyWindow)EditorWindow.GetWindow (typeof (MyWindow));
       
        SceneView.onSceneGUIDelegate += window.OnSceneGUI;
    }
   
    public void OnSceneGUI(SceneView sceneview)
    {
        if( Event.current.isMouse )
        {
            //Debug.Log("HANDLE ON SCENE GUI: " + Event.current.type + ", button: " + Event.current.button);
        }
    }

--
[  JPG  ]

Andy Zupko

unread,
Jun 2, 2011, 8:23:54 PM6/2/11
to unity3d-d...@googlegroups.com
There is a mouseup - i use it in my projects.

Event.current.type == EventType.MouseUp

gl hf!

--
You received this message because you are subscribed to the Google
Groups "Unity3D Developers" group.
To post to this group, send email to unity3d-d...@googlegroups.com
To unsubscribe from this group, send email to
unity3d-develop...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/unity3d-developers?hl=en

John Grden

unread,
Jun 2, 2011, 11:16:54 PM6/2/11
to unity3d-d...@googlegroups.com
well, yes, but that doesn't work :)  Note that I'm using a EditorWindow object, and the way I'm even getting the OnSceneGUI events is by subscribing to the SceveView delegate.

I  get mouseDown, mouseMove and other events, but no MouseUp.
--
[  JPG  ]

Yilmaz Kiymaz

unread,
Jun 3, 2011, 10:29:19 AM6/3/11
to unity3d-d...@googlegroups.com
I believe this is because of the currently active tool (move/rotate/scale) consuming it before it gets to you. There is a Tools editor class (or a variable/enum of an editor class) that you can set to None to prevent that from happening.

Yilmaz

John Grden

unread,
Jun 3, 2011, 2:36:48 PM6/3/11
to unity3d-d...@googlegroups.com
haha awesome Yilmaz!  I'll try that - and btw, it was your post on the request site for Unity ( and the reply about OnSceneGUI delegate ) that tipped me off to that little gem ;)

I seriously hope they work that out - I could think of quite a few tools that would require access to manipulating the scene and getting feedback

Thanks man,

John
Reply all
Reply to author
Forward
0 new messages