Problem
The 'HandlesResourceDisposal' attribute is missing from the JetBrains.Annotations package provided via the Unity UPM package but is available when using the NuGet package, causing inconsistencies between development environments.
Cause [Optional]
Unity's version of the JetBrains.Annotations package does not include all attributes available in the NuGet version, likely due to customized implementation or selective inclusion.
Resolution
If you need the 'HandlesResourceDisposal' attribute within a Unity project, you can manually include the annotation definitions from the JetBrains.Annotations package into your Unity project. To do this, follow these steps:
- Open Rider IDE and navigate to Settings → Editor → Inspection Settings → Code Annotations.
- Utilize the "Copy C# implementation to clipboard" feature to get the JetBrains annotations.
- Create a new .cs file in your Unity project's Assets directory and paste the copied definitions into this file.
Note: Careful attention is required to avoid conflicts with existing Unity classes, as the manually added classes could overlap with Unity's own definitions. Review the file for potential conflicts and comment out unnecessary definitions.
Comments
0 comments
Please sign in to leave a comment.