© 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_2

2. Customizing the Editor with Attributes and Callbacks

Benny Kok1  
(1)
Hong Kong, China
 

In this chapter, I will talk about the simplest way to customize your inspector experience in Unity. Starting from a simple C# PlayerBehaviour script as an example, I will walk you through the customization process by using the built-in C# PropertyAttribute in Unity. Next, I will talk about other useful attributes and some editor messages for MonoBehaviour that are useful for editor scripting.

Using the Property Attribute

In Unity, when you have a public or serializable field in your C# script ...

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.