Unity打开新项目报错
如下圖所示,第一次打開項(xiàng)目的時(shí)候報(bào)錯(cuò),
內(nèi)容大致為:
FileNotFoundException: Could not find file “D:\GithubProjects\Navigation\VoxelWorldandAstarRoadGenerator\Voxel-World-and-A-star-Road-Generator\Voxel World and A-star Road Generator\Library\PackageCache\com.unity.analytics@3.2.2\Tests\Editor\Unity.Analytics.StandardEvents\Unity.Analytics.StandardEvents.EditorTests.asmdef”.
System.IO.FileStream…ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:305)
System.IO.FileStream…ctor (System.String path, FileMode mode, FileAccess access, FileShare share)
(wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
System.IO.File.OpenRead (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:363)
System.IO.StreamReader…ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamReader.cs:167)
神奇的是,可以按Clear清除掉Console里的內(nèi)容,就不會(huì)報(bào)錯(cuò)了,然而點(diǎn)擊Play后會(huì)有新的報(bào)錯(cuò),但是有沒有提示具體問題出在哪里,如下圖所示:
報(bào)錯(cuò)內(nèi)容如下:
All compiler errors have to be fixed before you can enter playmode!
UnityEditor.SceneView:ShowCompileErrorNotification()
如果重新打開Unity,仍然會(huì)發(fā)現(xiàn)第一個(gè)圖所示的報(bào)錯(cuò),這就很神奇。
解決辦法
根據(jù)錯(cuò)誤提示FileNotFoundException: Could not find file,應(yīng)該是文件路徑太長(zhǎng)了,導(dǎo)致Unity找不到,我的路徑有這么長(zhǎng)
于是直接把項(xiàng)目移到D盤,發(fā)現(xiàn)可以正常運(yùn)行了
總結(jié)
以上是生活随笔為你收集整理的Unity打开新项目报错的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 面试题的一些汇总
- 下一篇: CentOS 下搭建 Hadoop:Pe