Search Unity

  1. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  2. Curious about what's going to be in 2021.1? Have a look at the 2021.1 beta 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:
    169
    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. :)
     
    ph3rin, FIFTYTWO, Ludiq and 5 others like this.
  3. Michael-Ryan

    Michael-Ryan

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