Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


CreateGUI()

CreateGUI is called when the EditorWindow's rootVisualElement is ready to be populated.
Read time 1 minuteLast updated 4 days ago

Definition

public void CreateGUI()

Remarks

Use
CreateGUI
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
CreateGUI
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.

Examples

{code Modules/UIElements/Tests/UIElementsExamples/Assets/EditorWindowCodeExamples/MouseOverWindowExample.cs}