- Home /
How do you bind a c# model's property to the menu
I was wondering how you go about getting properties to appear in the menu for game objects. For example if I had a custom script which had a Name property (with public getter and setter) and was applied to a cube how can I make a field in the menu for someone to fill in the Name for this game object.
I thought it would be done via attributes, and saw the AddComponentMenu attribute, but this doesnt seem to have had any effect. Could someone point me in the right direction?
Comment
Best Answer
Answer by whydoidoit · Jul 25, 2012 at 06:04 PM
The only way you can expose properties is by writing a Custom Inspector for your class. See here. Unity does not support properties in the default inspector view - it bugs me too, but there you go.