- Home /
EditorGUILayout.Knob() !?
While digging through MSVC's Intellisense for EditorGUILayout (in a Unity 5 project), I noticed a method with the following signature:
public static float Knob(Vector2 knobSize, float value, float minValue, float maxValue, string unit, Color backgroundColor, Color activeColor, bool showValue, params GUILayoutOption[] options);
I've failed to find any documentation about this method. In fact, even Google wasn't much help at all... So I decided to test it out for myself. As it turns out, it's a static (uneditable) control, resembling a "circular slider" of sorts, in the shape of the letter "C". And it also seems like it doesn't fully function as you would expect, unless the min/max threshold is between 0 and 1... Which is annoying to me, considering the awkward clockwise direction that it scrolls in would be more appealing as counter-clockwise, considering the right-most indent in it's shape.
So does anybody have any more information about this thing? Namely... Why is it undocumented, not fully-functional, and made public in the offical Unity v.5.0.0f4 release? And why not a full circle, or at least a U-shape instead?
y = EditorGUILayout.$$anonymous$$nob(new Vector2(50, 50), y, -5.0f, 15.0f, "x", Color.red, Color.green, false);
seems to work for me.
It's working fine for me at the moment. However, it draws pretty blurry when scaled and isn't as customizable. I haven't seen it anywhere else, so I guess it's just one of those features, that somebody built, but then never were implemented in the editor. Still a cool looking control, if you have use for it.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Renderer on object disabled after level reload 1 Answer
How can I make a tool bar show in the game view window using editor scripting? 0 Answers
Is possible to use EditorStyle on Unity in-game to do Horizontal Groups of Buttons? 0 Answers