I do not maintain this asset. I recommend to Unity WebVR Assets.
WebVR template and assets for creating WebVR-enabled Unity projects.
- Windows users: Overwrite
C:\Program Files\Unity\Editor\Data\PlaybackEngines\webglsupport\BuildToolswithWebGLTemplates. - Mac users: Copy the
WebGLTemplatesinto yourAssetsfolder.
From File > Build Settings, select WebGL as the platform.
- Open
Edit > Project Settings > Playerto access thePlayersettings. - Under
Resolution and Presentation, selectWebVRas your WebGL template.
- Copy
WebVRCameraSet.prefabfrom theWebVRAssets/prefabsfolder into yourAssets. - Replace your default
Main Camerawith theWebVRCameraSetprefab. - Copy
WebVRAssets/Scripts/StereoCamera.csinto yourAssets, and ensure that it is attached to the parent node of the prefab.
Once your project finishes building, open the generated index.html in a WebVR-enabled browser.
To copy the files over to your project:
UNITY_WEBVR_PROJECT=$HOME'/my-project/' sync.shこのアセットはメンテナンスをしていません。代わりにMozillaが作成したUnity WebVR Assetsの使用をお勧めします。
UnityでWebVRに対応したWebGLビルドを行うテスト用のテンプレートおよびアセット
###使い方 WebGLTemplatesフォルダーを、
- Windowsの場合 C:\Program Files\Unity\Editor\Data\PlaybackEngines\webglsupport\BuildToolsのフォルダーに上書きします。
- Macの場合 Assetsフォルダーにコピーします。
これで、Build Settings > WebGL > Player Settings > Publishing Settings > WebGL Template にWebVRというテンプレートが追加されます。
次にWebVRAssetsフォルダー内のPrefabフォルダーとScriptsフォルダーをAssetsフォルダにコピーします。 PrefabsフォルダーにはWebVRCameraSetというPrefabがありますので、このカメラを適当に配置し、WebVRCameraSetにScriptsフォルダー内にあるStereoCamera.csをアタッチします。
あとは、WebGLでWebVRテンプレートを使ってビルドを行い、出力されたindex.htmlにアクセスすればできます。


