- Home /
Is there a list of variable attributes for C#?
I remember reading somewhere that there were something like 50 variable attributes that we had access to if we were scripting in c#. The attributes I'm talking about look like this
[Range(float,float)]
float someFloat;
or
[Tooltip(string)]
var anyVariable;
Every one I've stumbled across has been, for the most part, awesometacular. Just wondering if there was a compiled list somewhere, or if Unity had official documentation on them someplace, I've been looking for a couple of weeks and haven't found anything except for a broken link to http://unity3d.com/support/documentation/ScriptReference/20_class_hierarchy.Attributes.html and the stuff straight from Microsoft which usually isn't super helpful for what I want to do https://msdn.microsoft.com/en-us/library/system.attribute.aspx#inheritanceContinued
That's in the sidebar of the Scripting API under Unity Engine -> Attributes, or
http://docs.unity3d.com/412/Documentation/ScriptReference/20_class_hierarchy.Attributes.html
Thanks hexagonius, I found that link before. Unfortunately, there are some attributes missing such as the Tooltip attribute that I know for sure exist. Based on that information, I would assume that it's an outdated list.
Answer by karl_ · Mar 27, 2015 at 05:10 PM
They're listed in the sidebar navigation of the docs under UnityEngine / Attributes
. I couldn't find a page dedicated to just the property attributes though.
Perfect! I have no idea how I missed that page. I spent about a week off and on looking at different sources and had even started to compile my own semi-complete list for reference because I wasn't able to find anything like that. The closest thing I could find was the link hexagonius mentioned, but that is by no means a complete list.
this page contains a list of all attributes: http://www.li0rtal.com/unity-attributes/
Answer by amitkuliyal · Oct 13, 2017 at 01:11 PM
Here is the list of all the attributes available :
https://docs.unity3d.com/ScriptReference/AddComponentMenu.html
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Set RangeAttribute to specific numbers 1 Answer