c# - 在 Unity3D 游戏脚本中使用带有 PIP 包的 Python 脚本

标签 c# python unity-game-engine import pip

我有很多用 Python 编写的功能,我想在 Unity3D 中使用它们(可能是 2018 年或 2019 年)。我考虑过使用 UniPython 或 IronPython,但从我读到的内容来看,这些插件仅嵌入 Python,因为您可以使用语法,但不能使用我的代码使用的 pip 安装的 python 包。

任何人都可以确认可用的 python 插件是否确实允许这样做 - 有没有一种方法可以将我的 python 代码添加到 Unity 中,而不必用 C# 重写它们,并且必须寻找等效的 C# 库?

我的最终目标是能够在 Unity 脚本中使用我的 Python 功能,无论是使用 Python 函数的 C# 脚本(如果可能的话),还是以允许我使用 Python 作为脚本语言的方式使用外部 python 包。

最佳答案

从版本 2.7.5 开始,IronPython 支持 pip。也许这会对您有所帮助。

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

关于c# - 在 Unity3D 游戏脚本中使用带有 PIP 包的 Python 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57324805/

相关文章:

c# - 默认值 C# 类

c# - 使用 C# 在 Silverlight 中向网格添加形状

python - pandas 列划分 ValueError (putmask : mask and data must be the same size)

python - 安装了 pip,但找不到 virtualenvwrapper_bashrc 在哪里

c# - 在被杀死的字符上方创建 GUI 文本

c# - DotNetRDF:Graph 或 CompressingTurtleWriter 不释放内存

c# - 服务堆栈 "Declaration referenced in a method implementation cannot be a final method"

python - 如何从句子中提取单词并检查其中是否不存在单词

android - 屏幕截图图像未显示在 Unity UI 上

c# - 无需 GA/GC 即可最佳获取千分之一秒字符串