Is it possible to customize how a variable of a certain type would look in the inspector?
I always used a different forum for my questions, so let's try the official one this time. ;)
I am making an RPG game, and I have a class called "Attack", which has some variables such as a name or a cost, and one of them is a delegate, so I can put a method which will be the method that will be called when attacking. I don't want to show the method in the inspector, because I can't set it to any value there anyway, but because of that delegate it can't show anything. I would like to write a custom inspector to show it, but I don't know how... I can just make a custom inspector for every component that has a variable of that type, but that would be silly. What I want to do is that every variable with that type would be shown in the inspector the way I choose it to. Like a string has a single text field, or a boolean a basic checkbox, I want to customize an Attack. Is it possible?
Answer by tanoshimi · Jun 26, 2016 at 03:59 PM
Yes - it sounds like you're describing a Property Drawer.
Your answer
Follow this Question
Related Questions
Custom Inspector changes not updating target in Edit Mode 1 Answer
Custom Editor List with child classes 1 Answer
Editor not showing default values 2 Answers
How to make drop down list of classes in an array of classes (in the inspector) 0 Answers
Is there a way to live-update script-controlled UI formatting in the editor? 0 Answers