Skip to main content

VR sample scene setup

This page explains how to set up the VR sample scene shipped with UniPay, so you can use it for testing IAPs in VR before integrating it in your own shop scene.

Prerequisites

For XR input, import the XR Interaction Toolkit into your project via the Package Manager, including the Starter Assets sample files.

VR-Setup010

If you are not using the new Input System yet, upon import this package will ask you to switch to it and restart Unity. Confirm that and in the Player Settings for your build platform, ensure that Input System Package (New) or Both is selected.

VR-Setup020

Map XR Input

Add the default controller inputs included in XR Interaction Toolkit to your Preset Manager as shown below (left & right, one by one).

VR-Setup030

VR-Setup040

Import VR sample scene

Import UniPay's VR sample scene by opening Project Settings > UniPay In-App Purchasing and clicking on the Virtual Reality button.

VR-Setup100

Open the scene, which can now be found in your project under UniPay > Extensions > VR > Scenes. Check that on its XROrigin game object, XR Interaction Toolkit's default input actions are assigned.

VR-Setup110

Play-Test

Finally on the Build Settings, drag in the newly imported VR scene, disable the non-VR related scenes as seen in the following screenshot, and make sure that the VR scene is the first scene to load.

VR-Setup120

Deploy the scene to your target platform and run it on your device!

VR-Setup130

note

Note that without making use of a VR store integration for billing, trying to buy a product will show the message Billing is not available. Please enable VR billing e.g. Oculus by following the Oculus Store guide.