This repository has been archived by the owner on Feb 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copied the HelloVR demo scene to create a GvrWebViewDemoScene.
- Loading branch information
1 parent
62c89bc
commit f421e67
Showing
9 changed files
with
2,073 additions
and
337 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
14 changes: 7 additions & 7 deletions
14
Assets/Scenes/SampleScene.unity.meta → Assets/Scenes/GvrWebViewDemoScene.unity.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: {} |
Oops, something went wrong.