Can't add script component because the script class cannot be found?

前端 未结 5 717
别那么骄傲
别那么骄傲 2020-11-27 06:47

Yesterday I updated unity from unity5 to 2018.2.2f1. Unity scripts are not loading after Update 2018.2.2f1.

Once I try to play the Scene the scripts are not loaded a

5条回答
  •  被撕碎了的回忆
    2020-11-27 07:22

    Posting here for historic purposes and if someone from Google ends up here, I strictly had the same problem (I'm on Windows 10) and here's how I fixed it :

    • If you click on the Console, you should see a blank error. Don't worry, it's a Editor bug, and you can see the Editor Log by selecting the console's window dropdown and selecting Open Editor Log.

    For me, the problem was that "Tools\Roslyn\csc" could not be found, something that Unity uses to compile C# files.

    • I opened C:\Program Files\Unity\Hub\Editor\2019.2.14f1\Editor\Data\Tools\RoslynScripts\unity_csc.bat and I added ".exe" to the line "%APPLICATION_CONTENTS%\Tools\Roslyn\csc" /shared %*

    (This line should now be : "%APPLICATION_CONTENTS%\Tools\Roslyn\csc.exe" /shared %*)

    Now it works perfectly.

提交回复
热议问题