c# - 当我在 Unity3D 中使用 IronPython 时,如何修复“类型 'ScriptRuntime' 是在未引用的程序集中定义的”
问题描述
我在 Unity3D 中使用 IronPython 通过 C# 导入 .py 文件。
但是,有一个错误。我不知道为什么。
“类型 '
ScriptRuntime
' 在未引用的程序集中定义。”
我不知道如何解决它。你可以帮帮我吗?非常感谢!
C# 代码
//I used several package
using UnityEngine;
using IronPython.Hosting;
using Microsoft.Scripting;
using System;
using System.Linq;
using System.Text;
using System.Collections;
using System.Collections.Generic;
错误出现在以下几行。
ScriptRuntime pyRunTime = Python.CreateRuntime();
dynamic obj = pyRunTime.UseFile("hello.py");
解决方案
推荐阅读
- r - 如何将 df 绑定到 df 列表
- git - 使用 master 中包含的特定 PR 创建一个分支
- python - 如何在烧瓶 python 中引用输入?
- javascript - Webpack:无限循环和自动生成的文件
- javascript - 向/从子 Svelte 组件传递可执行函数引用?
- c++ - 为什么不创建临时对象?
- javascript - {} 和 new Object() 有区别吗
- c++ - c++ 类的方法中的虚拟是否会渗透到它的子级
- python - 无法在 selenium python 中获取跨度值
- google-sheets - 当同一行中的值更改为另一个值时,我希望数字列表指示移动