小编loa*_*our的帖子

NotSupportedException:C#Unity 5中的动态模块不支持调用的成员

这是我的毕业设计。游戏的想法是通过提供一些有趣的任务来帮助学生练习编程,这些任务需要C#代码解决方案,例如encodingame.com,当用户产生正确的输出时,结果将在Unity场景中可视化。

我正在使用C#编译器插件在Unity 5运行时中编译用户的代码。一切工作正常(每个场景都单独开始在编辑器中播放场景并停止它),但是当我从场景前进到下一个场景时,在运行时构建用户的C#代码时,此错误会上升(NotSupportedException:被调用的成员)在动态模块中不受支持)(错误总是在第二个场景或下一个场景中出现)。

错误:

NotSupportedException: The invoked member is not supported in a dynamic module
Run Code Online (Sandbox Code Playgroud)

错误

产生错误的行:

this.assemblyReferences = domain.GetAssemblies().Select(a => a.Location).ToArray();
Run Code Online (Sandbox Code Playgroud)

assemblyRefrences是字符串数组:string [] assemblyReferences;

该行在其构造函数中的脚本ScriptBundleLoader中

c# compiler-construction unity5

3
推荐指数
1
解决办法
2199
查看次数

标签 统计

c# ×1

compiler-construction ×1

unity5 ×1