简体   繁体   English

将Python脚本与Unity3D游戏脚本中的PIP包一起使用

[英]Using Python scripts with PIP packages in Unity3D game scripts

I have bunch of functionality written in Python that I would like to use in Unity3D (Possibly 2018 or 2019). 我有很多用Python编写的功能,希望在Unity3D中使用(可能是2018或2019)。 I considered using UniPython or IronPython but from what I read these plugins only embed Python ,as in you can use the syntax but not python packages installed with pip, which my code uses. 我考虑使用UniPython或IronPython,但从我读到的这些插件来看,它们仅嵌入Python,因为您可以使用语法,而不能使用随pip安装的python包,而我的代码使用了pip。

Can anyone confirm if the available python plugins will actually allow this or if not - Is there a way I can add my python code into Unity without having to rewrite them in C# and have to look for equivalent C# libraries? 任何人都可以确认可用的python插件是否实际上允许这样做吗?-有没有一种方法可以将我的python代码添加到Unity中,而不必用C#重写它们,也不必寻找等效的C#库?

My end goal is to be able to use my python functionality inside of Unity scripts, whether that would be C# scripts using Python functions (if at all possible) or moving to Python as a scripting language in a way that would allow me to use external python packages. 我的最终目标是能够在Unity脚本中使用我的python功能,无论是使用Python函数的C#脚本(如果可能)还是以允许我使用外部语言的方式迁移到Python作为脚本语言python软件包。

As of version 2.7.5 IronPython supports pip. 从2.7.5版开始,IronPython支持pip。 Maybe this will help you. 也许这会对您有所帮助。

https://ironpython.net/blog/2014/12/07/pip-in-ironpython-275.html https://ironpython.net/blog/2014/12/07/pip-in-ironpython-275.html

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

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