Unity 中的 NuGet 包 [英] NuGet packages in Unity

查看:43
本文介绍了Unity 中的 NuGet 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Unity 中使用一些 NuGet 包.我实现了 Unity 根据这篇文章找到下载的 DLL (https://www.what-c​​ould-possively-go-wrong.com/unity-and-nuget/).nuget.config 文件可以配置为将包下载到 Assets 文件夹内的 Plugins 文件夹中.问题是 NuGet 下载每个 DLL 的多个版本(例如 net46、netcore50、netstandard21 等),而 Unity 不喜欢多个具有相同名称的 DLL.我知道我可以简单地手动将 DLL 放入 Plugins 文件夹中,但不幸的是,这不是一个让我满意的解决方案.

I want to use some NuGet packages inside Unity. I achieved that Unity finds the downloaded DLLs according to this article (https://www.what-could-possibly-go-wrong.com/unity-and-nuget/). The nuget.config file can be configured to download the packages into the Plugins folder inside the Assets folder. The Problem is that NuGet downloads multiple versions of each DLL (eg net46, netcore50, netstandard21, so forth) and Unity doesn't like multiple DLLs with the same name. I know I could simply put the DLL inside the Plugins folder by hand, but unfortunately that is not a solution which would please me.

你知道我如何解决这个问题吗?是否可以将 NuGet 配置为只为每个依赖项下载一个 DLL?

Do you have any idea how I could work around this problem? Is it possible to configure NuGet to just download one DLL for each dependency?

推荐答案

只是想我会添加这个以防它对任何人有帮助

Just thought I'd add this in case it helps anyone

我使用了 Nuget for Unity 资产(免费)来导入包 (websocketsharp),它是真的很容易和无痛.VS 中的引用也立即生效

I used the Nuget for Unity asset (free) to import a package (websocketsharp) and it was really easy and painless. The references in VS worked immediately as well

您自然要尝试导入的包必须与 Unity 兼容,但即使您手动导入也是如此.所以我建议尝试一下

The package you're trying to import naturally has to be compatible with Unity but that's the same even if you import it manually. So I'd recommend giving this a try

这篇关于Unity 中的 NuGet 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆