Unity内置软件包编译器错误 [英] Unity built-in Packages Compiler Errors

查看:626
本文介绍了Unity内置软件包编译器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

添加2D程序包后,这是控制台(无文本错误): 从软件包中添加字符后,检查人员会说以下话(无法加载关联的脚本.请修复所有编译器错误并分配一个有效的脚本): 如图所示,我正在使用统一的5.6.0f3 64位. 我尝试再次卸载并重新下载它,但这没有用. 我尝试创建一个新的空项目,导入一个程序包并运行,但是还是没用.

I just started learning how to use Unity to make a simple 3D game. It's working fine when it comes to creating the environment, but once I imported the built-in Character package it gave me a compiler error and wouldn't run (All compiler errors have to be fixed before you can enter playmode!).
Removing the imported package removes the error and it can run, I tried using other built-in packages like 2D or Cameras but same problem occurred.

After adding 2D package, here's the console (error with no text): After adding a character from the package, here's what the Inspector says (the associated script cannot be loaded. please fix all compiler errors and assign a valid script): As shown in the pictures I'm using unity 5.6.0f3 64-bit. I tried uninstalling and re-downloading it again but that didn't work. I tried creating a new empty project, import a package and hit run, still didn't work.

推荐答案

来自这篇文章.

您好,我将其报告为错误,而我今天才刚从Unity收到回复.尝试将系统区域设置更改为非阿拉伯语.转到控制面板>更改日期,时间或数字格式>管理标签>更改系统区域设置

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


检查脚本文件名是否与文件中的类名相同?它们应该相同.


Check if the script file name is the same as the class name in the file? They should be the same.

更新

查看图片的这一部分.

文件中没有Monobehaviour脚本,或者名称与文件名不匹配.

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

并从此处

如果命名空间中的MonoBehaviours具有带有默认参数的方法(例如public void Foo(bool bar = true)),则会中断.

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

另请参见此处.

似乎是 帖子中的解决方案:

在另一台计算机上可能会收到一条错误消息,它与 在此线程中提到: 为Unity创建托管DLL失败,并显示错误导入Unity时

Could get a Error message on another computer and it's the same as mentioned in this Thread: Creating managed DLL for Unity fails with error when importing into Unity

导致的原因: http://forum .unity3d.com/threads/5-2-1p3-mono-cecil-assemblyresolutionexception-unityengine-ui-dll.361666/

我实际上可以通过手动删除Unity的所有剩余部分来解决它 卸载后和Monodevelop(例如 C:\ Users [您的用户名] \ AppData \ Local等),然后重新安装 5.2.3f.

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.

这篇关于Unity内置软件包编译器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆