14
5

More than 3 years have passed since last update.

【Unity】ビルドせずに実機デバッグできるAR Foundation Editor Remote

Last updated at Posted at 2020-09-01

AR Foundation Editor Remoteについて

Asset Store

公式ドキュメントを元にして、iOSで使う場合について説明します。

ARCompanionアプリをビルドしてiPhoneにインストールすると、iPhoneとPCでカメラの情報を通信できるようになり、UnityのGameSceneで確認ができるというものです。

自分の環境

Unity 2019.4.1f1
ARFoundation 3.0.1
ARKit XR Plugin 3.0.1

Macbook Pro 13 2017 Mid メモリ8GB
MacOS 10.14.6

iPhone XS
iOS 13.6

使い方

推奨環境

ARFoundation 3.0.1
ARKit XR Plugin 3.0.1

iOSのフェイストラッキングを有効にするには、パッケージマネージャ経由でARKit Face Tracking 3.0.1をインストールします

(XR Management パッケージ v.3.2.10以降をサポートしているUnityのバージョンでのみ必要です。
Project Settings → XR Plug-in Management → PC, Mac & Linux Standalone でAR Foundation Remote providerを有効にする)

1. ビルド

Package Managerから
ARFoundation 3.0.1
ARKit XR Plugin 3.0.1
をインストールします。

フェイストラッキングを使う場合、ARKit Face Tracking 3.0.1もインストールします。

Asset StoreからAR Foundation Editor Remoteをインポートして、iPhoneをPCと接続します。

ターゲットプラットフォームをiOSに変更して、Project/Plugins/ARFoundationRemoteInstallerのInstaller.assetのinstall AR Companion appボタンをクリックするとXcodeが立ち上がり、アプリのビルドが始まります。
この時Unityでエラーが起こっている場合はボタンを押す前に解決しておいてください。

スクリーンショット 2020-09-01 11.03.14.png

AR Companion appのインストールに失敗した場合は、エラーを修正し、Delete Companion app build folderボタンを押してからインストールを繰り返します。
Assets/Plugins/ARFoundationRemoteInstaller/Scenes/Senderに入っているSceneを変更するとビルドがうまくいかなくなります。

2. 実機テスト

iPhoneでARCompanion Appを起動します。

UnityのAssets/Plugins/ARFoundationRemoteInstaller/Resources/Settings.assetのIPに、iPhoneに表示されているIPを入力します。

iPhoneでアプリを立ち上げたままUnityをPlayすると、GameSceneでARの様子が確認できるようになります。
画面タップも反応します。

以上です!

14
5
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
5