Nuget Unity



Roslyn analyzers for Unity game developers

For projects that support PackageReference, copy this XML node into the project file to reference the package.
  • Showing the top 5 NuGet packages that depend on Unity.Interception: Package Downloads; EnterpriseLibrary.Common.NetCore The Enterprise Library Common assembly contains elements that are shared among multiple application blocks. By supplying a set of commonly used functions to all the application blocks, the Common assembly reduces the.
  • With the changes below a huge number of new nuget packages are working with Nuget for Unity! Greatly improved logic for selecting target frameworks, including.NET Standard. New support for Dependencies grouped by target framework. Issues installing newer versions of modules with 100 versions have been fixed.
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.

The Unity Application Block (Unity) is a lightweight extensible dependency injection container with support for constructor, property, and method call injection. It facilitates loosely-coupled design. NuGetForUnity is a NuGet client built from scratch to run inside the Unity Editor. NuGet is a package management system which makes it easy to create packages that are distributed on a server and consumed by users. NuGet supports sematic versioning for.

The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Documentation for this release.

Show more

Dependencies

  • .NETStandard 2.0

    • No dependencies.

Used By

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on Microsoft.Unity.Analyzers:

RepositoryStars
CitiesSkylinesMods/TMPE
Cities: Skylines Traffic Manager: President Edition
IllusionMods/BepisPlugins
A collection of essential BepInEx plugins for games made by Illusion.
DeathWeasel1337/KK_Plugins
Plugins for Koikatsu, EmotionCreators, AI Girl, and Honey Select 2

Version History

Nuget
VersionDownloadsLast updated
1.10.1 82 4/20/2021
1.10.0 1,177 2/16/2021
1.9.1 782 1/5/2021
1.9.0 749 11/21/2020
1.8.2 427 9/22/2020
1.8.1 190 9/2/2020
1.8.0 316 7/20/2020
1.7.1 293 6/19/2020
1.7.0 791 6/9/2020
Show more

This project provides nuget support trough sdk-style csproj files in Unity, with a Unity Editor tool.

The editor utility can be started from the Unity Csproj / Open window menu item.

The project assumes that you are using asmdef in your project in a structure:

This might change in the future, but right now it is a recommended pattern nevertheless.

Why this and not NugetForUnity

Although NugetForUnity is a great project, it has several constraints:

  • Can’t easily use specific nuget versions through nugget.org
  • It still has problems with downloading the required dlls 123
  • If you are working on other projects the generated csproj file can be used to directly reference them making it easier to work with projects not directly targeting Unity. Just add a reference to it.

Nuget Unity Package

How does it work?

The main idea is this blog post I wrote a while back. We are creating a .net framework project which we will use to generate the needed dlls, and then let Unity discover them. This project builds on that concepts, and automates the creation of the needed project file.

How do I use it?

  1. Install the dotnet core sdk, and make sure it is available in your PATH
  2. Install the project through either openupm (this is recommended) or with the provided unitypackage.
  3. Launch the csproj window as shown on the above image
  4. This window will enumerate through all of your asmdef files, and will let you create a csproj file for it’s dependencies, and also place a folder named NugetDlls with a gitignore for the dlls and their meta files. The csproj is placed in a folder called .nuget which will be ignored by Unity. If you do not want to use the provided gitignore files, then delete them after initialization.
  5. Regenerate the Unity project files through either the “Regenerate project file” button, or in the Unity options: “Edit/Preferences/External Tools”.
  6. Launch Visual Studio and add nuget packages to the generated project file, or use the dotnet cli tools
  7. Build the generated project from either Visual Studio, the dotnet cli or through the provided Editor UI
  8. (Optional) This is not needed if your are using Unity 2020.1 and have the latest Visual Studio package. If you are using Visual Studio to debug then unload the generated projects from Visual Studio, so they do not interfere when attaching to Unity.
  9. You are done!

Nuget Unity Container

Settings

SettingDescription
Add projects to solutionWhether to add the initialized projects to the unity-generated solution file, when the project is regenerated

Nuget Unityengine

Settings are persisted in the root unity folder in the NugetOptions.xml file. To save and apply the settings press the “Save settings” button.

Additional stuff

Add Nuget Package To Unity

  • When Unity generates the solution files your nuget projects will be added to the solution. If you want to debug your Unity project you may need to unload them from the solution by right clicking on them in Visual Studio. (Only when using Unity older than 2020.1)
  • If you want to use this in a CI-CD environment then you don’t need to manually run dotnet build for the nuget projects. The project comes with an IPreprocessBuildWithReport which will do the same thing as the Build All button.
  • Running the build command will replicate the output of the dotnet cli to the Unity Debug console.

Gotchas

Add Nuget Package

  • Although it was not tested on Linux and MacOS building the generated projects should work via the .Net Framework reference assemblies, so a dotnet -build should just work.
  • You only need to initialize a project once, when you set this up. Initializing again might override the packages you added.
  • Tested with Unity version 2019.4 but other recent versions (2018+) should work
  • The same gotchas are expected when just dealing with manually adding dlls
  • Never forget that this project does nothing magical, it just automates the process of getting the needed dlls to be recognized with Unity