Unity 内置包编译器错误

Unity built-in Packages Compiler Errors

我刚开始学习如何使用 Unity 制作简单的 3D 游戏。 在创建环境时它工作正常,但是一旦我导入了内置的 Character 包,它给了我一个编译器错误并且不会 运行 (必须修复所有编译器错误才能进入播放模式! ).
删除导入的包可以消除错误,它可以 运行,我尝试使用其他内置包,如 2D 或 Cameras,但出现了同样的问题。

添加 2D 包后,这里是控制台(没有文本的错误): 从包中添加角色后,Inspector 会显示以下内容(无法加载相关脚本。请修复所有编译器错误并分配有效脚本): 如图所示,我使用的是 unity 5.6.0f3 64 位。 我尝试卸载并再次重新下载,但没有用。 我尝试创建一个新的空项目,导入一个包并点击 运行,仍然没有成功。

来自 this post 的有效解决方案。

Hi, I reported this as a bug and I just got the response from Unity today. Try changing system locale to not Arabic. Go to Control Panel > Change date, time or number format> Administrative tab> Change system locale


检查脚本文件名是否与文件中的class名称相同?他们应该是一样的。

更新

看到这部分图片。

No Monobehaviour scripts in the file, or the names do not match the file name.

here,

MonoBehaviours inside namespaces break, if they have a method with a default parameter (such as public void Foo(bool bar=true)).

另见 here


这似乎与 Compile Error with empty message 的问题相同。

来自post的解决方案:

Could get a Error message on another computer and it's the same as mentioned in this Thread:

Which lead to this: http://forum.unity3d.com/threads/5-2-1p3-mono-cecil-assemblyresolutionexception-unityengine-ui-dll.361666/

I could actually solve it with manually deleting all remains of Unity and Monodevelop after the deinstallation (ex. C:\Users[YourUserName]\AppData\Local etc. ) and then reinstalling 5.2.3f.