Hello,
I updated to Unity 4.1.0 recently from 3.5 on a Mac. I am using a C# script called GUILayoutx.cs taken from the very handy FileBrowser in the Wiki. There's an if statement there, which checks if a GUI element is doubled clicked as follows:
else if (hover && callback != null && Event.current.type == EventType.MouseUp && Event.current.clickCount == 2)
{
//action to perform
callback(i);
Debug.Log(i);
Event.current.Use();
}
Before the update everything was functioning, but anymore the double-clicking is not. I narrowed down the problem and I believe it is the "Event.current.clickCount == 2" to blame, because when I set the value to 1 it works, while otherwise it doesn't enter the if statement.
I found this: "Mac OS X: Event.clickCount behavior for double-clicks now matches windows (clickCount is always 1 for MouseUp events)." taken from [here][1]. Do you think it is might also related?
Or maybe the problem goes deeper and for some reason another condition is not fulfilled before the second click. For instance the callback becomes null very fast...
Thank you!
[1]: http://unity3d.com/unity/whats-new/unity-4.0
↧