此页面由 Cloud Translation API 翻译。
首页
产品
ARCore
文档
升级到 AR Foundation 版本 5
适用于 Unity 的 AR Foundation 的 ARCore 扩展程序同时支持 4 版和 5 版 AR Foundation。如需将现有的 AR 项目从 AR Foundation 4.x 升级到 AR Foundation 5.x,请按以下步骤操作:
仅适用于 Unity 2021.x 或更低版本:
某些 Unity 软件包绑定到特定的 Unity 编辑器版本。在某些 Unity 编辑器版本中,您可能需要修改 Unity 项目中的软件包清单,才能更新到 AR Foundation 5.x。如需了解详情,请参阅在 Unity 2021 中访问 AR Foundation 5.0。
确保 Packages/manifest.json 包含以下软件包的以下版本:
"dependencies": {
-- other dependencies --
"com.google.ar.core.arfoundation.extensions": "https://github.com/google-ar/arcore-unity-extensions.git#arf5",
"com.unity.xr.arcore": "5.0.5",
"com.unity.xr.arfoundation": "5.0.5",
"com.unity.xr.arkit": "5.0.5",
-- other dependencies --
}
AR Foundation 5.x 因依赖于 TrackedPoseDriver 而需要 Input System 软件包。ARCore Extensions 示例场景需要旧版输入模块。
如需同时支持输入系统软件包和旧版输入管理器,请在 Project Settings > Player > Other Settings 中将 Active Input Handling 设置为 Both。
按照 Unity 的 AR Foundation 升级和迁移指南中的其他步骤操作。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-14。
[null,null,["最后更新时间 (UTC):2025-07-14。"],[[["ARCore Extensions for Unity's AR Foundation supports both AR Foundation version 4 and 5."],["To upgrade to AR Foundation 5.x, Unity 2021 or older users may need to update their package manifest to ensure compatibility."],["AR Foundation 5.x requires the Input System package but maintains backward compatibility with the legacy input module by setting \"Active Input Handling\" to \"Both\"."],["Consult Unity's AR Foundation upgrade and migration guides for comprehensive instructions beyond package updates and input settings."]]],[]]