Property Drawers | Unity Editor Scripting
Otter Knight
Today is the day where you learn how to make your cool classes look extraordinary in the Unity inspector. There is a world of opportunities awaiting for those who master the art of making property drawers, as they allow you to completely customise how serializable classes are drawn in the inspector. This doesn’t just mean a pretty environment, it also means that you can implement functionality that ensures everything is forced to work properly together.
Who does that lovely, new voice belong to, you ask? That’s just the man who has edited all our videos so far and made the thumbnails. You may very well be hearing more from him in the future.
This video can be watched fine on its own, but it can be seen as a sequel to the mini-series on property attributes. That series can be found here: https://youtube.com/playlist?list=PLqy--wDEnoVLsXSCHEUNwqZ8j2S509rBu
In this video we’ll be making a class called EnumDataContainer that will work as a wrapper around an array and a drawer that then will force the array to map to a given enum. Sounds familiar? That’s because we tried to achieve the same with an attribute in the last video we made. Only now it’s cooler and better. Among other goodies, you’ll get a sneak peek of the cool things you can do with generic classes and indexers.
When you get more advanced at Unity and want development to be both faster and smoother, it’s time to look into Editor Scripting. Learning about concepts like attributes, property drawers, custom editor windows, custom inspectors, and scripts running in the editor, can open a whole new world in game development. Learning about these topics can seem daunting and like it requires you to already have a good understanding of many other advanced concepts. This series will take you from being a beginner at editor scripting to having the ability to create your own level editors.
Unity PropertyDrawer Manual: https://docs.unity3d.com/Manual/editor-PropertyDrawers.html Unity EditorGUI Reference: https://docs.unity3d.com/ScriptReference/EditorGUI.html C# Indexers Guide: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/indexers/ C# Generics Tutorial: https://youtu.be/YEHbjy3JBtE
····················································································
Timestamps: 0:00 Introduction 1:29 Problem 3:42 Container Class 8:27 Property Drawer 18:24 Life wisdom 20:20 Outro
····················································································
Discord Server: https://discord.gg/NsCvyHYWwq Twitter: https://twitter.com/otter_knight
····················································································
End music: Track: JJD - Adventure [NCS Release] Music provided by NoCopyrightSounds. Watch: https://www.youtube.com/watch?v=f2xGx... Free Download / Stream: http://ncs.io/adventure
173483832 Bytes