CreateGUI()
CreateGUI is called when the EditorWindow's rootVisualElement is ready to be populated.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEditor
public void CreateGUI()
Remarks
Use to add UI Toolkit UI elements to your window. When creating a custom Editor window, follow these guidelines: - Put code dependent on UXML/USS loading in the EditorWindow.CreateGUI() method to ensure that all necessary assets are available. - Keep the event registration code inside EditorWindow.CreateGUI() or after EditorWindow.CreateGUI() is called. It's important to note that might not be called before the first call to EditorWindow.Update(). For more information, refer to EditorWindow. For an example on how to create an Editor window to react to user input, refer to Create a custom Editor window with C# script.
CreateGUICreateGUIExamples
{code Modules/UIElements/Tests/UIElementsExamples/Assets/EditorWindowCodeExamples/MouseOverWindowExample.cs}