Skip to content

Demonstrates how to use 3D WebView with XR Interaction Toolkit

License

Notifications You must be signed in to change notification settings

vuplex/xr-interaction-webview-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XR Interaction Toolkit WebView Example

This Unity project demonstrates how to use Vuplex 3D WebView with Unity's XR Interaction Toolkit (XRI). It includes XRI and its dependencies, so all you need to do is import 3D WebView into the project. Please note that input with XRI requires 3D WebView's CanvasWebViewPrefab. XRI input with the non-canvas WebViewPrefab is not supported.

demo

Steps taken to create this project

  1. Created a new project with Unity 6 (6000.0.21).

  2. Imported the following via the Package Manager:

    • XR Interaction Toolkit (com.unity.xr.interaction.toolkit) v3.0.7
    • From the "Samples" tab of the XR Interaction Toolkit package, imported the "Start Assets" sample.
    • 3D WebView for Android (omitted from this repo via the .gitignore)
  3. Created a copy of the DemoScene.unity scene from the XRI Starter Assets sample, which I named XRInteractionWebViewExample.unity:

cp "Assets/Samples/XR Interaction Toolkit/3.0.7/Starter Assets/DemoScene.unity" Assets/Scenes/XRInteractionWebViewExample.unity
  1. Made the following changes to the new XRInteractionWebViewExample.unity scene:

    • Added a CanvasWebViewPrefab and CanvasKeyboard to the scene's UI Sample canvas.
    • Added a "Scripting API Example" object with an XRInteractionWebViewExample.cs script that demonstrates how to use 3D WebView's scripting APIs.
    • Removed all objects from the scene that aren't necessary for demonstrating interaction with the webview.
    • Modified the color settings of the controllers' LineVisual objects to make the controller ray easier to see.
  2. In Project Settings -> XR Plugin Management:

    • Clicked "Install XR Plugin Management".
    • In the Android tab -> Plug-in Providers, enabled Oculus.

Troubleshooting

3D WebView's prefabs detect input through Unity's event system like described in this article. In the case of XR Interaction Toolkit, the scene's XRUIInputModule sends input through Unity's event system, which 3D WebView's prefabs then detect. If your CanvasWebViewPrefab and CanvasKeyboard aren't responding to clicks or scrolling, then that indicates that your scene is not configured correctly. I recommend using this project as a reference and verifying the following settings in your scene:

About

Demonstrates how to use 3D WebView with XR Interaction Toolkit

Resources

License

Stars

Watchers

Forks

Packages

No packages published