© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
B. KokBeginning Unity Editor Scriptinghttps://doi.org/10.1007/978-1-4842-7167-4_3

3. Custom Editor with IMGUI

Benny Kok1  
(1)
Hong Kong, China
 

Now that you have learned some helpful editor attributes and editor-specific messages in MonoBehaviour, it’s time to dive into coding a custom GUI yourself.

With Unity Editor, the majority of the GUI can be created with the EditorGUILayout and GUILayout classes under the hood. They are immediate mode GUI classes with an automatic layout calculation built on top of the EditorGUI and GUI classes, and they provide a straightforward way of GUI drawing. By design, each line of IMGUI code should be called every time to output ...

Get Beginning Unity Editor Scripting: Create and Publish Your Game Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.