LoginSignup
12

More than 5 years have passed since last update.

Unity5でOculus

Last updated at Posted at 2015-03-06

Oculusの開発案件がきたので、実装に向けて細かい部分をメモします。

Oculus SDKの導入

インポート

まずは、本家のサイトよりSDKをダウンロード

Oculus
https://developer.oculus.com/downloads/#sdk

このZipファイルの中にSDKのパッケージが入っているので、対象のプロジェクトにインポートしましょう。
通常のパッケージのインポートと同じです。

コードエラー

Unity5.0.0にインストールした際に、OVRMainMenu.csの247行目と966行目にエラーが発生しました。SDKのバージョンはOculus SDK 0.4.4となります。

このエラーは、RenderModeクラスのRenderMode.Worldが存在しないことによるエラーとなります。
まだUnity5がβ版の時のSDKですので、リリースに向けて変更された内容になります。

こちら正しくはc.renderMode = RenderMode.WorldSpace;と修正すると良いでしょう。
念のため、リファレンスも残しておきます。

RenderMode
http://docs.unity3d.com/ScriptReference/RenderMode.html

RenderMode.WorldSpace
http://docs.unity3d.com/ScriptReference/RenderMode.WorldSpace.html

各247行目と966行目は以下のように修正しましょう。

OVRMainMenu.cs
#if UNITY_5_0
        // TODO: Unity 5.0b11 has an older version of the new GUI being developed in Unity 4.6.
        // Remove this once Unity 5 has a more recent merge of Unity 4.6.
        c.renderMode = RenderMode.WorldSpace;

#else

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
12