Unity built-in Packages Compiler Errors

半腔热情 提交于 2019-12-11 03:38:19

问题


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.


回答1:


A working solution from 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


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

UPDATE

See this part of the picture.

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

And from here,

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

See also here.


And it seems an identical issue of Compile Error with empty message.

Solution from the post:

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

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.



来源:https://stackoverflow.com/questions/43403709/unity-built-in-packages-compiler-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!