在Unity 5使用.NET 4.5 code [英] Using .NET 4.5 code in Unity 5

查看:905
本文介绍了在Unity 5使用.NET 4.5 code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个游戏使用Unity3D版本5.游戏应该使用已经编在C#.NET4.5引擎严格的业务规则。使用Xamarin /单声道,我们希望能够让这个可用在Windows,Android的,其他人...

I am working on a game using Unity3D version 5. The game should use strict business rules already programmed in a C# .NET4.5 engine. Using Xamarin/Mono, we hope to make this usable on windows, android, others...

我试图建立发动机进入一个dll,并用它作为一个统一管理的插件。但是,统一使用旧版本的Mono编译整场比赛,并拒绝使用.NET 4.5的DLL。

I tried building the engine into a dll and use it as a managed plugin in Unity. But Unity uses an old version of Mono to compile the whole game and refuses to use .NET 4.5 dlls.

我真的需要使用这种code,我看着它降级到.NET 3.5,但它不是考虑到这项工作已经完成在发动机上可以接受的解决方案。

I really need to use this code, I looked into downgrading it to .NET 3.5 but it is not an acceptable solution given the work already done on the engine.

关于Android的,我想用Xamarin获得原生的Andr​​oid code和使用它作为一个团结本地插件。现在我需要为Windows的解决方案。我期待到如何使用C#code在C ++中,使非托管的dll,但我在努力理解它的方法是适用在这里COM互操作,C ++ / CLI或其他方法之间。

Concerning android, I think to use Xamarin to get native android code and use it as a native plugin in Unity. Now I need a solution for Windows. I am looking into ways to use the C# code in C++ to make an unmanaged dll but I am struggling understanding which way is applicable here between COM interop, C++/CLI or other methods.

是否有任何人知道一种方法,包括.NET 4.5中统一code无/举手之劳?

Does any one knows a way to include code from .NET 4.5 in Unity with no/little effort ?

推荐答案

使用Visual Studio的插件:的,我已经能够出口C#.NET 4.5非托管/本机DLL,我可以在Unity引擎使用nofollow的>非托管的出口。 这迫使调用只有简单的功能,但很少有工作,有可能对我来说,我的包裹引擎的核心。

Using a visual studio plugin: unmanaged exports, I have been able to export the C# .NET 4.5 to an unmanaged/native dll which I can use in Unity Engine. This forces to call only simple functions, but with little work, it was possible for me to wrap the core of my engine.

这篇关于在Unity 5使用.NET 4.5 code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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