Skip to content

Demonstrates how to view and interact with web content on Apple Vision Pro using Vuplex 3D WebView with Unity's RealityKit app mode for visionOS.

License

Notifications You must be signed in to change notification settings

vuplex/visionos-realitykit-webview-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

visionOS RealityKit WebView Example

This Unity project demonstrates how to view and interact with web content on Apple Vision Pro using Vuplex 3D WebView with Unity's RealityKit app mode for visionOS. All you need to do is import 3D WebView for visionOS into the project and then build one of the following scenes:

  • RealityKitWindowedWebViewExample scene: demonstrates using VisionOSWebView.CreateInWindow() to open a webview in a native visionOS (SwiftUI) window.
  • RealityKitCanvasWebViewExample scene: demonstrates using a CanvasWebViewPrefab to display and interact with web content in a Unity UI Canvas.

Screenshot of running the project in the visionOS simulator

Steps taken to create this project

  1. Created a new project with Unity 6 (6000.0.25) using the 3D URP project template.
  2. Opened the Unity Package Manager and did the following:
    • Imported v2.3.1 of the com.unity.polyspatial.visionos package and its dependencies.
    • On the page for the com.unity.polyspatial package, clicked on the "Samples" tab and clicked "Import" button for "Unity PolySpatial Samples".
  3. To create the RealityKitWindowedWebViewExample scene:
  4. To create the RealityKitCanvasWebViewExample scene:
    • Made a copy of PolySpatial's GUI sample scene and named it RealityKitCanvasWebViewExample.
    • Added a CanvasWebViewPrefab to the RealityKitCanvasWebViewExample scene's Canvas and set its Initial URL field.
    • Added a RealityKitCanvasWebViewExample.cs script that demonstrates how to use 3D WebView's scripting APIs.
    • Removed unneeded objects from the RealityKitCanvasWebViewExample scene.
  5. Updated the following project settings:
    • "XR Plug-in Management": enabled the "Apple visionOS" XR plugin
    • "XR Plug-in Management" -> "Apple visionOS":
      • Changed the App Mode to "RealityKit"
      • Added values for "Hand Tracking Usage Description" and "World Sensing Usage Description"
      • Enabled "IL2CPP Large Exe Workaround"
    • Player Settings:
      • Disabled "Show Splash Screen"
      • Changed "Color Space" to "Linear"

About

Demonstrates how to view and interact with web content on Apple Vision Pro using Vuplex 3D WebView with Unity's RealityKit app mode for visionOS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages