Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Document on Code Attributes

Discussion in 'Scripting' started by attilam, Aug 20, 2008.

  1. attilam

    attilam

    Joined:
    Jun 2, 2007
    Posts:
    86
    Hey all,

    is there/has anyone compiled a list of all the code attributes, that can be used (or at least the ones that are Unity specific)? I'm stumbling upon more and more in different scripts in tutorials as well as other people's code, but there doesn't seem to be a document, that would have them all.

    Also, it seems like the different scripting languages have different ways to write them, I wonder what functionality is still hidden ;)

    Maybe a page on the wiki would be cool to have on this... ?

    cheers,
    Attila
     
  2. Charles Hinshaw

    Charles Hinshaw

    Joined:
    Feb 6, 2008
    Posts:
    1,070
  3. attilam

    attilam

    Joined:
    Jun 2, 2007
    Posts:
    86
    Yeah, I've found a lot of them there (via Search), but scattered around in separate documents. Maybe reordering the Script classes tree in the documentation would help (to clearly show, that these are Attributes)

    Also, stuff like 'DllImport' is nowhere to be found and general syntax (across languages) isn't explained either.
     
  4. Charles Hinshaw

    Charles Hinshaw

    Joined:
    Feb 6, 2008
    Posts:
    1,070
    Ok, so I have no clue what you are talking about then -- stuff that is Unity specific (so not just general .Net and C# attributes) but that isn't covered in the documentation in related areas?

    Can you give an example?
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
  6. jeremyace

    jeremyace

    Joined:
    Oct 12, 2005
    Posts:
    1,661
    Most of the Attributes are not Unity-Specific actually.

    Unity-specific ones that I can find are:

    - RPC
    - ContextMenu
    - ExecuteInEditMode
    - HideInInspector
    - RenderBeforeQueues
    - RequireComponent
    - SerializePrivateVariables
    - CustomEditor
    - DrawGizmo
    - MenuItem

    Plus whatever else I forgot.

    -Jeremy
     
  7. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
    This is the stuff I see:

    Code (csharp):
    1.  
    2. imac1:ScriptReference matthew$ grep "inherits from Attribute" *
    3. AddComponentMenu.html:  <span class="text">Class, inherits from Attribute</span>
    4. ContextMenu.html:   <span class="text">Class, inherits from Attribute</span>
    5. ExecuteInEditMode.html: <span class="text">Class, inherits from Attribute</span>
    6. HideInInspector.html:   <span class="text">Class, inherits from Attribute</span>
    7. NonSerialized.html: <span class="text">Class, inherits from Attribute</span>
    8. RPC.html:   <span class="text">Class, inherits from Attribute</span>
    9. RenderBeforeQueues.html:    <span class="text">Class, inherits from Attribute</span>
    10. RequireComponent.html:  <span class="text">Class, inherits from Attribute</span>
    11. Serializable.html:  <span class="text">Class, inherits from Attribute</span>
    12.