Search Unity

  1. Want to see 2020.1b in action? Sign up for our Beta 2020.1 Overview Webinar on April 20th for a live presentation from our evangelists and a Q&A session with guests from R&D.
    Dismiss Notice
  2. Interested in giving us feedback? Join our online research interviews on a broad range of topics and share your insights with us.
    Dismiss Notice
  3. We're hosting a webinar for the new Input System where you'll be able to get in touch with the devs. Sign up now and share your questions with us in preparation for the session on April 15.
    Dismiss Notice
  4. 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:
    152
    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. :)
     
    FIFTYTWO, Ludiq, gtzpower and 4 others like this.
  3. Michael-Ryan

    Michael-Ryan

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