How to use 3D WebView with XR Interaction Toolkit?

3D WebView's prefabs automatically detect input from Unity's Event System like described in this article. Unity's XR Interaction Toolkit (XRIT) includes the input module XRUIInputModule, which is compatible with 3D WebView's CanvasWebViewPrefab and CanvasKeyboard prefabs. For an example of how to use XRIT with these prefabs, please see this example project. Here's a summary of what a scene should include in order to use XRIT with 3D WebView:

At runtime, XRIT adds an XRUIInputModule to the scene, which enables the CanvasWebViewPrefab and CanvasKeyboard to detect input from XRIT.

Limitations:

  • 3D WebView's non-Canvas WebViewPrefab and Keyboard prefabs don't support XRIT because XRBaseInteractable doesn't expose an API to detect drag events. In contrast, the XRUIInputModule input module used for CanvasWebViewPrefab does support drag events.
  • CanvasWebViewPrefab doesn't currently support hover interactions with XRIT.