Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Embedded JetBrains.Annotations in (v5) UnityEngine.dll

Discussion in 'Unity 5 Pre-order Beta' started by Michael-Ryan, Feb 28, 2015.

  1. Michael-Ryan

    Michael-Ryan

    Joined:
    Apr 10, 2009
    Posts:
    184
    We use ReSharper with our project, and have previously included a copy of JetBrains.Annotations. See http://answers.unity3d.com/questions/625936/vs-2013-w-resharper-start-update-ongui-is-never-us.html for more info.

    After upgrading the project to Unity 5, I discovered that UnityEngine.dll has its own copy of the JetBrains.Annotations namespace embedded inside it. Does anyone know if this is intentional and will it be included in all future versions of Unity?

    If so, I'll remove our copy from the project.
     
    Last edited: Mar 1, 2015
  2. scobi

    scobi

    Unity Technologies

    Joined:
    May 14, 2014
    Posts:
    32
    This is intentional, yes, and you can rely on the attributes being included in all future versions of Unity. I embedded them directly for a few reasons:
    • Save users the trouble of adding references to the DLL and copying files around.
    • Remove non-applicable or obsolete attributes to reduce Intellisense noise.
    • Enable easy use for Unity engineers on internal code. (Some of these might eventually show up attached to public API's if it makes sense.)
    I used the "Copy default implementation to clipboard" to get the source, and removed Asp*, Html*, and Razor* (not needed in the land of Unity), plus some redundant and obsolete attributes. Then I added missing attributes found in the JetBrains.Annotations.xml in the ReSharper install folder. I'm not sure why JetBrains has different attributes in their default implementation vs embedded in their DLL.

    As new versions of R# come out I'll keep these up to date. Ping me if I mess anything up for you. :)
     
    ivaylo5ev, ph3rin, FIFTYTWO and 6 others like this.
  3. Michael-Ryan

    Michael-Ryan

    Joined:
    Apr 10, 2009
    Posts:
    184
    This is extremely informative. Thanks very much for the update and for including these annotations in Unity!