Unity导入Goolgle.Protobuf.dll报错
報錯信息
描述:在直接導入Google.Protobuf.dll時會出現以下兩個報錯信息
1.Assembly ‘Library/ScriptAssemblies/Assembly-CSharp.dll’ will not be loaded due to errors:
Reference has errors ‘Google.Protobuf’.
2.Assembly ‘Assets/Plugins/Google.Protobuf.dll’ will not be loaded due to errors:
Unable to resolve reference ‘System.Runtime.CompilerServices.Unsafe’. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.
報錯原因
Google.Protobuf.dll 里面有的依賴并不是UnityEditor里面的版本,所以就會出現unity報錯,但是VS2022內不報錯的情況
解決方法
下載Google Protobuf 的開源代碼使用VS2022生成解決方案,再把bin>Debug>net45文件夾內容全部一起導入unity即可
下載地址:https://github.com/protocolbuffers/protobuf/releases
問題解決
總結
以上是生活随笔為你收集整理的Unity导入Goolgle.Protobuf.dll报错的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python地图可视化前端页面展示_利用
- 下一篇: 儿童吹泡泡水简单配方_儿童吹泡泡水简单配