Unity 用の ARCore Extensions を使用して ARCore セッションを構成する
ARCore セッションを構成して、アプリの AR エクスペリエンスを構築します。
セッションとは
モーション トラッキング、環境の把握、照明の推定など、すべての AR プロセスは ARCore セッション内で行われます。ARSession
は、ARCore API のメインのエントリ ポイントです。AR システムの状態を管理し、セッションのライフサイクルを処理します。これにより、アプリはセッションの作成、構成、開始、停止を行うことができます。最も重要な点として、カメラ画像とデバイスのポーズにアクセスできるフレームをアプリが受信できるようになります。
このセッションを使用して、次の機能を構成できます。
AR Foundation と ARCore Extensions を設定する
ARCore Extensions を使用するには、AR Foundation を設定する必要があります。AR シーンを設定する手順については、AR Foundation の設定に関するドキュメントをご覧ください。
ARCore セッションを構成する前に、ARCore Extensions を設定する必要があります。まだ設定していない場合は、ARCore Extensions の設定に関するドキュメントをご覧ください。
ARCore で新しいセッション構成を作成します。
Unity で Assets >
Create > XR > ARCore Extensions Config に移動して、新しいセッション構成を作成します。
デフォルトの構成は次のようになります。

[Hierarchy] ペインで、ARCore Extensions オブジェクトを選択します。
Inspector ペインの ARCore Extensions Config フィールドで、ターゲット
ボタンをクリックし、ARCoreExtensionsConfig アセットに接続します。
AR セッションの管理
AR Foundation 2.1 と 3.1 では、ARSession ゲーム オブジェクトを破棄すると、基盤となる ARCore セッションも破棄されます。
AR Foundation 4.0 以降では、代わりに LoaderUtility
関数を使用してサブシステムを破棄および作成する必要があります。AR Foundation の 3.x から 4.x への移行ガイドをご覧ください。
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-02-28 UTC。
[null,null,["最終更新日 2025-02-28 UTC。"],[[["An ARCore session manages all AR processes like motion tracking and environmental understanding, and is accessed through the `ARSession` object."],["Before configuring an ARCore session, ensure both AR Foundation and ARCore Extensions are properly set up in your Unity project."],["You can configure extension features within the ARCoreExtensionsConfig asset, which allows you to customize session behavior."],["Starting with AR Foundation 4.0, session management is handled through `LoaderUtility` functions instead of destroying the `ARSession` game object."],["After configuring your session, explore the provided quickstart guides for Android and iOS to begin building AR experiences with ARCore Extensions."]]],["An ARCore session is essential for AR processes like motion tracking and lighting estimation. `ARSession` manages the AR system state, including session creation and configuration, and enables access to camera images and device pose. Before configuring the ARCore session, AR Foundation and ARCore Extensions must be set up. You need to create an `ARCore Extensions Config` asset in Unity and connect it to the `ARCore Extensions` object. Session management is done using `LoaderUtility` functions in newer versions of AR Foundation.\n"]]