LoginSignup
175
136

More than 5 years have passed since last update.

UnityでiOSのARKitを動かす手順

Last updated at Posted at 2017-06-06

UnityでiOSのARKitのプロジェクトをビルドし、動かすまでの手順です。

追記(2017/06/17)

ARKitができる事、できない事についてまとめた記事を投稿しました。
http://qiita.com/arumani/items/6efad65a17e2eafde5a1

追記(2017/06/07)

チュートリアルの日本語訳を投稿しました。
http://qiita.com/arumani/items/74dc65ceb9c90bd986ee

実行結果

平面認識 UnityARKitScene

平面に対して立方体を適切なサイズで置く事ができます。

ポジショントラッキング UnityParticlePainter

Tilt Brushのように空間上に色を置く事ができます。

環境

Unity 5.6.1p1以降を入手

Unity - Unity QA - Patch Releases
現状パッチバージョンが必要なので、ここからダウンロードします。

Xcode 9 beta版を入手

Download - Apple Developer
ここからダウンロードします。有料のApple開発者アカウントが必要です。
このbeta版はインストールせずに起動できるので、既存のXcode環境を壊さずに試せます(旧バージョンの起動以外は確認していないので、どこかに影響あったらすみません)。

iOS 11 beta版を入手

Xcode 9と同じく Download - Apple Developer からダウンロードできます。
私はimageをiTunes経由でインストールしました。

Unity ARKit Pluginを入手

Unity-Technologies / Unity-ARKit-Plugin — Bitbucket
からダウンロードします。私はUnityフォーラムに投稿されていた以下のURLからunitypackageを直接ダウンロードしました。
https://oc.unity3d.com/index.php/s/3hfM9T05P9vOpCf

手順

  1. 新規Unityプロジェクトを作成し、上記のプラグインパッケージをimport
  2. PlatformをiOSに切り替える
  3. Player Settingsの"Camera Usage Description"に何か文字列を入れる
    ※これを入れないとアプリがカメラ利用許可を得られず、起動時に落ちます

  4. UnityARKitScene / UnityParticlePainter をビルド対象に追加してビルド

  5. Xcode 9 betaで、通常のアプリと同様にビルド、実機で実行する

実行結果

※本エントリ冒頭の画像と説明参照

参考URL

AppleのARKitホーム
ARKit - Apple Developer

Unityフォーラム
ARKit support for iOS via Unity-ARKit-Plugin | Unity Community

Unity ARKit Pluginレポジトリ
Unity-Technologies / Unity-ARKit-Plugin — Bitbucket

175
136
0

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
175
136