简体   繁体   English

IronPython(适用于.NET 4.x)与Unity集成

[英]IronPython (for .NET 4.x) integration with Unity

I am trying to integrate a python script with my Unity application using Visual Studio 2017. I have followed all the steps given in the various online tutorials, and this is my code: image 我正在尝试使用Visual Studio 2017将python脚本与Unity应用程序集成。我已按照各种在线教程中给出的所有步骤进行操作,这是我的代码: image

Also, when I go to the Unity inspector, this is the error seen when I select the dll (saved in Assets/Editor/plugins/resources directory): image2 I have installed the latest version of IronPython which states that it is compatible with .NET 4.x as well as 3.5. 另外,当我进入Unity检查器时,这是我选择dll(保存在Assets / Editor / plugins / resources目录中)时看到的错误: image2我已经安装了IronPython的最新版本,该版本声明与兼容。 NET 4.x和3.5。

Could someone please suggest a fix for this, or some other alternative to use for Python integration? 有人可以为这个问题提出修复建议,或者为Python集成提供其他替代方法吗?

The error message is telling you that your editor is incompatible with the .NET version you are using. 错误消息告诉您您的编辑器与您使用的.NET版本不兼容。 You may wish to update your path to include both the .NET 3.5 and 4.0 versions. 您可能希望更新路径以包括.NET 3.5和4.0版本。

Unity includes an experimental runtime version that supports .NET 4.6, but it is not the default. Unity包括一个支持.NET 4.6的实验性运行时版本,但它不是默认版本。 To select this choose Edit -> Project Settings -> Player . 要选择此选项,请选择Edit -> Project Settings -> Player Then in the Inspector Window scroll down to Other Settings -> Configuration -> Scripting Runtime Version . 然后在“检查器”窗口中向下滚动到“ Other Settings ->“ Configuration ->“ Scripting Runtime Version Select Experimental (.NET 4.6 Equivalent) from the menu. 从菜单中选择Experimental (.NET 4.6 Equivalent)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM