Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Commit

Permalink
Copied the HelloVR demo scene to create a GvrWebViewDemoScene.
Browse files Browse the repository at this point in the history
  • Loading branch information
binarynate committed Feb 27, 2019
1 parent 62c89bc commit f421e67
Show file tree
Hide file tree
Showing 9 changed files with 2,073 additions and 337 deletions.
1,871 changes: 1,871 additions & 0 deletions Assets/Scenes/GvrWebViewDemoScene.unity

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

253 changes: 0 additions & 253 deletions Assets/Scenes/SampleScene.unity

This file was deleted.

8 changes: 8 additions & 0 deletions Assets/Scripts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions Assets/Scripts/GvrWebViewDemo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using UnityEngine;
using Vuplex.WebView;

class GvrWebViewDemo : MonoBehaviour {

WebViewPrefab _webViewPrefab;
Keyboard _keyboard;

void Start() {

// Create a 0.6 x 0.4 instance of the prefab.
_webViewPrefab = WebViewPrefab.Instantiate(0.6f, 0.4f);
_webViewPrefab.transform.parent = transform;
_webViewPrefab.transform.localPosition = new Vector3(0, 0f, 0.6f);
_webViewPrefab.transform.LookAt(transform);
_webViewPrefab.Initialized += (sender, e) => {
_webViewPrefab.WebView.LoadUrl("https://www.google.com");
};

// Add the keyboard under the main webview.
_keyboard = Keyboard.Instantiate();
_keyboard.transform.parent = _webViewPrefab.transform;
_keyboard.transform.localPosition = new Vector3(0, -0.41f, 0);
_keyboard.transform.localEulerAngles = new Vector3(0, 0, 0);
// Hook up the keyboard so that characters are routed to the main webview.
_keyboard.InputReceived += (sender, e) => _webViewPrefab.WebView.HandleKeyboardInput(e.Value);
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/GvrWebViewDemo.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions ProjectSettings/EditorBuildSettings.asset
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1045 &1
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/Scenes/SampleScene.unity
guid: 99c9720ab356a0642a771bea13969a05
m_configObjects: {}
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1045 &1
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/Scenes/GvrWebViewDemoScene.unity
guid: 17d47216fb08249b8a95500352a2d5df
m_configObjects: {}
Loading

0 comments on commit f421e67

Please sign in to comment.