首页 文章

DLL中的Unity c#脚本

提问于
浏览
2

在Unity 4.1项目中,我希望将所有C#脚本都放在DLL中 . Unity创建一个Visual Studio项目,我能够正确编译代码 . 编译生成DLL但Unity不识别所有类,只识别那些继承MonoBehaviour的类 . 所有课程都是公开的,Unity是专业的 . 如何让Unity“看到”所有课程?

我尝试使用Mono 2.8进行编译,它构建了DLL . 所有类似乎都存在,但没有任何作用,我得到这些错误:

ApplicationException: Unable to find a suitable compiler
    UnityEditor.Scripting.ScriptCompilers.CreateCompilerInstance (MonoIsland island, Boolean buildingForEditor, BuildTarget targetPlatform) (at                                                         
    C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/Scripting/ScriptCompilers.cs:99)

Failed to create compiler instance

2 回答

相关问题