日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Unity打开新项目报错

發布時間:2024/3/12 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Unity打开新项目报错 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

如下圖所示,第一次打開項目的時候報錯,

內容大致為:
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里的內容,就不會報錯了,然而點擊Play后會有新的報錯,但是有沒有提示具體問題出在哪里,如下圖所示:


報錯內容如下:
All compiler errors have to be fixed before you can enter playmode!
UnityEditor.SceneView:ShowCompileErrorNotification()

如果重新打開Unity,仍然會發現第一個圖所示的報錯,這就很神奇。

解決辦法
根據錯誤提示FileNotFoundException: Could not find file,應該是文件路徑太長了,導致Unity找不到,我的路徑有這么長

D:\GithubProjects\Navigation\VoxelWorldandAstarRoadGenerator\Voxel-World-and-A-star-Road-Generator\Voxel World and A-star Road Generator

于是直接把項目移到D盤,發現可以正常運行了

總結

以上是生活随笔為你收集整理的Unity打开新项目报错的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。