Open NeistH2o opened 1 month ago
Unfortunately, Unity has their own copy of the annotations and they're public
, so become part of Unity's public API. Ideally, they would have added them as internal
. Rider/ReSharper would still see the annotations, but they wouldn't become part of their API, and Unity projects could easily add their own copy for their own code.
Unity can keep their copy up to date if they wish, and we have worked with them in the past to update things, but that still requires updating Unity versions and so on.
The best thing to do now is to add a copy of the annotations to your Unity project, and then simply delete any conflicting type definitions. This might not be an elegant solution, but it is fairly straightforward and will work fine.
Oh, and you can use the Copy C# implementation to clipboard button on the Code Annotations settings page in Rider/ReSharper to get a copy of the annotations without having to download them from GitHub. Makes it a little easier.
Hi there,
I wanted to use the
MustDisposeResourceAttribute
in my unity project. I couldn't find a way to import this package in the project, so I copied over the relevant files from here to my project.[MustDisposeResource]
does work now, but I had to comment parts ofAnnotations.cs
likeCanBeNullAttribute
, because it led to ambiguous declarations with the already provided annotations in Unity.Is there any plan to make these attributes available in Unity by default?
EDIT: Maybe there is a way to import nuget packages in unity projects from Rider, sorry if I missed something obvious.