问题描述:
在 Unity 空项目导入 Unity Playground 包时出现Deterministic compilation failed. You can disable Deterministic builds in Player Settings
Library\PackageCache\com.unity.multiplayer-hlapi@1.0.4\Editor\Tools\Weaver\AssemblyInfo.cs(22,28): error CS8357: The specified version string contains wildcards, which are not compatible with determinism. Either remove wildcards from the version string, or disable determinism for this compilation
问题分析:
这是由于运行 Unity Playground 所需的 Multiplayer HLAPI 包版本过低导致。
解决方案是升级包,如果你用的是 2020 之前版本,可以成功。但 Unity 2021之后已经更换了新的多人游戏库,这个库不再支持。所以建议编辑器安装 2020 版本的。
解决办法:
更新 multiplayer-hlapi,点击“Windows”----“Package Manager”,在Packages中下拉选择“In Project",找到”Multiplayer HLAPI",点击右下角 Update to 1.0.8 进行更新,直到版本后面是绿色对号。
更新完之后,成功导入!