© 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  
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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.