Unity3D - 我可以使用 .NET 4.5 程序集作为外部库吗?

Unity3D - can I use .NET 4.5 assembly as external library?(Unity3D - 我可以使用 .NET 4.5 程序集作为外部库吗?)
本文介绍了Unity3D - 我可以使用 .NET 4.5 程序集作为外部库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用在 .NET Framework v4.5 中实现的一组功能.因为 Unity3D 在 Mono 运行时(相当于 .NET 3.5)上工作,我认为使用 .NET4.5 程序集作为外部插件.

I want to use set of features, implemented in .NET Framework v4.5. Cause Unity3D works on Mono runtime(equivalent to .NET 3.5), i think to use .NET4.5 assemblies as external plugin.

有可能吗?如果可能,该库将使用哪个运行时 - Mono 或程序集的目标运行时(在我的情况下为 .NET 4.5)?

Is it possible? If it possible, which runtime will be used for this libraries - Mono or assembly's target runtime (.NET 4.5 in my case)?

推荐答案

据我所知你不能,因为 unity 在单声道上运行.看看这里 http://docs.unity3d.com/410/Documentation/ScriptReference/MonoCompatibility.html

As far as I know you can't because unity runs on mono. Have a look here http://docs.unity3d.com/410/Documentation/ScriptReference/MonoCompatibility.html

基本上,Unity 升级到 .NET 3.5 或更高版本,具有一些类似于 c# 4.0 的功能,例如可选参数.

Basically, Unity goes upto .NET 3.5 or there about, with some features similar to c# 4.0 like optional parameters.

要记住的主要一点是,尽管您在构建设置中看到了什么,但 Unity3d 并未使用 .NET 2.0.

The main thing to keep in mind is that Unity3d is not using .NET 2.0 despite what you see in the build settings.

编辑 2:

我在某处看到您绝对不能直接引用 4.5 程序集.现在找不到资源了.

I've seen somewhere that you definitely can't reference 4.5 assemblies directly. Cant' find the resource now.

无论如何,我想有可能制作一个调用 4.5 程序集的 C++ 包装器.问题是即使你编写了一个以这种方式工作的包装器,它也只能在 Windows 机器上工作.基本上是因为单声道无法在任何其他平台上支持它们.再次在理论上.

In any case, I suppose it may be possible to make a C++ wrapper that would call 4.5 assemblies. The thing is even if you wrote a wrapper that worked this way, it would only work on windows machines. Basically due to the fact that mono isn't able to support them on any other platform. Again in theory.

免责声明:单声道支持部分只是一个有根据的猜测.我不是 100% 的.

DISCLAIMER : The mono support part is just an educated guess. I'm not 100 % on that.

这也是一个很好的阅读C#的正确版本号是什么?

这篇关于Unity3D - 我可以使用 .NET 4.5 程序集作为外部库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)