Property Attributes - Part 2 | Unity Editor Scripting
Otter Knight
This video is the second of many that focus on property drawers and how to make them. Property drawers are used to change how variables are displayed in the inspector in Unity, which is awesome. You should start with the first video, as this and coming ones expect you to have watched all previous ones. The first video can be found here: https://odysee.com/@OtterKnight/UES-property-attributes-1
This video focuses on making our own attributes in Unity (known as property attributes) and then making property drawers to display them the way we want. Today we make a property attribute that you can put on a variable of type Object. It will then allow you to make sure only interfaces of a specific type can be assigned to it. I call it ForceInterfaceAttribute. It expands on the concepts introduced in the last video and will provide a solid foundation for making your own attributes. Happy coding!
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 Manual Page: https://docs.unity3d.com/Manual/edito... Type.IsAssignableFrom(Type): https://docs.microsoft.com/en-us/dotn... Type checking: https://stackoverflow.com/questions/9...
····················································································
Timestamps: 0:00 Introduction 0:44 Problem 1:20 Property Attribute 2:49 Property Drawer 12:11 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
135088241 Bytes