升級至 AR Foundation 第 5 版
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Unity 的 ARCore 擴充功能支援 AR Foundation 的第 4 版和第 5 版。如要將現有的 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
。ARCore 擴充功能範例場景需要舊版輸入模組。
如要同時支援 Input System 套件和舊版 Input Manager,請在「Project Settings」>「Player」>「Other Settings」中,將「Active Input Handling」設為「Both」。
請按照 Unity 的 AR Foundation 升級和遷移指南中的其他步驟操作。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eARCore Extensions for Unity's AR Foundation supports both AR Foundation version 4 and 5.\u003c/p\u003e\n"],["\u003cp\u003eTo upgrade to AR Foundation 5.x, Unity 2021 or older users may need to update their package manifest to ensure compatibility.\u003c/p\u003e\n"],["\u003cp\u003eAR Foundation 5.x requires the Input System package but maintains backward compatibility with the legacy input module by setting "Active Input Handling" to "Both".\u003c/p\u003e\n"],["\u003cp\u003eConsult Unity's AR Foundation upgrade and migration guides for comprehensive instructions beyond package updates and input settings.\u003c/p\u003e\n"]]],[],null,["# Upgrade to AR Foundation version 5\n\nARCore Extensions for Unity's AR Foundation supports both\n[version 4](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/manual/index.html)\nand\n[version 5](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.1/manual/index.html)\nof AR Foundation. To upgrade your existing AR project to AR Foundation 5.x from\nAR Foundation 4.x, follow these steps:\n\n1. Only in **Unity 2021.x** or older: \n\n Some Unity packages are [bound to specific Unity Editor versions](https://docs.unity3d.com/Manual/pack-safe.html).\n You may need to edit the [Package manifest](https://docs.unity3d.com/Manual/upm-manifestPkg.html)\n in your Unity project to update to AR Foundation 5.x in certain Unity Editor\n versions. For more information, see [Access AR Foundation 5.0 in Unity\n 2021](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.0/manual/project-setup/edit-your-project-manifest.html).\n\n Ensure that the **Packages/manifest.json** contains these versions for the\n following packages: \n\n \"dependencies\": {\n -- other dependencies --\n \"com.google.ar.core.arfoundation.extensions\": \"https://github.com/google-ar/arcore-unity-extensions.git#arf5\",\n \"com.unity.xr.arcore\": \"5.0.5\",\n \"com.unity.xr.arfoundation\": \"5.0.5\",\n \"com.unity.xr.arkit\": \"5.0.5\",\n -- other dependencies --\n }\n\n2. AR Foundation 5.x requires the [Input System package](https://docs.unity3d.com/Packages/com.unity.inputsystem@1.8/manual/index.html)\n due to a dependency on [`TrackedPoseDriver`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.0/changelog/CHANGELOG.html#500-pre6---2021-11-17).\n The ARCore Extensions Sample Scenes require the legacy input module.\n\n To support both the Input System package and the older Input Manager,\n in **Project Settings \\\u003e Player \\\u003e Other Settings** set **Active Input\n Handling** to **Both**.\n3. Follow other steps in Unity's AR Foundation\n [upgrade and migration guides](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.1/manual/version-history/migration-guide-5-x.html)."]]