返回「计算机、信息技术与工程」

unity里 Api Compatibility Level .net 4.x 与 .netstandard 2.0 的区别是什么呢

更多
Markdown 结构化数据
本文目录 3 个章节

unity里 Api Compatibility Level .net 4.x 与 .netstandard 2.0 的区别是什么呢

note · 我的 UWA 问答 本文收录我在 UWA 问答发表的公开回答。问题内容归原提问者;回答保留当时语境,技术结论可能受 Unity 版本、平台和项目条件限制。

问题

unity里 Api Compatibility Level .net 4.x 与 .netstandard 2.0 的区别是什么呢

  • 提问者:游走
  • 提问时间:2021-05-18 17:46:15

我的回答

.NET Standard 2.0 对平台的支持性更广、兼容性更好。.NET Standard 2.0的API是.NET 4.x的子集。

或者说,.NET 4.x支持的API更多一些,兼容.NET Standard 2.0,但是有些API在有些平台上是不兼容的。

Unity默认选择的是.NET Standard 2.0,如果想要跨平台兼容,那么就选Standard 2.0。如果使用的外部类库或者脚本里面调用的API不被Standard 2.0支持,再考虑换成4.x来试试。

以官方文档为准:https://docs.unity3d.com/Manual/dotnetProfileSupport.html

  • 回答时间:2021-05-18 22:13:49
  • 最后更新:2021-05-18 22:13:49
  • 采纳状态:已采纳

来源与关系