- Home /
[AttributeUsage(AttributeTargets.Field)] - how do I use it?
How can I use [AttributeUsage(AttributeTargets.Field)] to create custom attributes so that I can conditionally only display certain variables from my script/component when looking at it in the Inspector if say they are not null, or say another public variable in the script has X value and so on. Can someone post some c# examples?
Comment
Your answer
Follow this Question
Related Questions
Where can I find a complete list of Attributes and how they work and 2 Answers
Distribute terrain in zones 3 Answers
InspectorEditor: Find target object that has focus 1 Answer
Some public attributes not shown in inspector, default references 3 Answers
Inspector attribute for showing a field with a custom name? Possible? 1 Answer