- Home /
Button in EditorGUI / ScriptableWizard?
How do I create a simple Button in a ScriptableWizard? I overwrite the OnGUI function so the standard create button doesn't appear. I tried using a GUILayout.Button, which worked, but when the OnWizardCreate function finishes I get a GUI NullReferenceException and because of that the window is not closed. Also I'm using EditorGUILayout and would like to define a area to draw into (like with GUILayout.BeginArea()). I tried using the normal GUILayout function for this, which also works, but creates an exception when the wizard finishes and prevents closing the window.
Is there any clever way to get a normal Button to display inside a ScriptableWizard and have it use auto-layout?
Answer by Waz · Nov 09, 2011 at 06:19 AM
You don't.
ScriptableWizard is a shorthand that takes a few inputs and does something. If you want a dialog more complex than that, use the ScriptableWizard base class (EditorWindow). Then you can have whatever you like in your OnGUI.
Your answer
Follow this Question
Related Questions
Setting custom amount of space between elements in a custom inspector with EditorGUILayout ? 1 Answer
How to combine two buttons in one. Editor window 2 Answers
Custom Editor - Is there any way to detect whether the user is in Prefab editing mode? 1 Answer
Is there a way to stylize EditorGUI.ObjectField? 0 Answers
Weird action in Unity editor when pressing the "E" key? 1 Answer