Unity+Pico: Configure the development environment and build the basic framework

1. Unity environment configuration

 1. Download and unzip PICO Unity Integration SDK

Unzip it locally, where package.json is the file used to add the SDK to the project.

Download and unzip PICO Unity Live Preview Plugin (Experiment)

Unzip it locally, where package.json is the file used by the screen preview function.

Download PICO Developer Center

Double-click the downloaded file

 

Customize the installation location and install it.

 

2. Install Unity

Download and install Unity Hub. After the installation is complete, click Install > Install Editor and select the long-term support version to download. Detailed version of installing and creating the first Unity project in Unity

Note: You need to check the development tools and Android components during installation. If the development tools have been installed, you do not need to check them.

3. Import SDK

Enter the Unity 3D project, click Window > Package Manager, click the "+" button on the Package Manager interface, select "Add package from disk...", jump to the directory where the SDK was decompressed in step 1, and select "package.json" You can import the PICO Unity Integration SDK.

The project will be restarted

If PICO Integration is displayed in In Project, the import is successful.

 

Click the "+" button on the Package Manager interface, select "Add package from disk...", jump to the directory where the PICO Unity Live Preview Plugin was decompressed in step 1, select "package.json" to import PICO Unity Live Preview Plugin.

Install the XR Interaction Toolkit, select Unity Registry from PackageManager, find the XR Interaction Tookit, and import the Samples package body.

At this time, select Pico on the XR Plugin Management Android page of Edit->Project Setting, and check PICO Live Preview on the PC page.

4. Configuration file

Open the path and all configuration files in the picture below, and click Add to for each configuration file. This is because OpenXR uses the latest Input System and needs to be updated here.

5. Modify project configuration

Click Edit > Project Settings to pop up the Project Settings interface. First modify the Player configuration. Under Player's "Other Settings", find the "Identification" option.

1) Set "Minimum API Level" to "Android 10.0 'Oreo' (API level 29)";

2) Set "Target API Level" to "Automatic (highest installed)" (default).

3) Change Scripting Backend to IL2CPP, uncheck ARMv7, and check ARMv64.

2. Use Pico SDK to build the basic framework

A basic scene includes directional light, ground, head display and controller. In the newly created Unity scene, directional lights and cameras will be automatically created. All we need to do is add a new ground in the scene and replace the default camera with the XR camera. 

1. Add new ground

Right-click > 3D Object > Plane to create a ground within the scene.

2. Add an XR camera to the scene.

Right-click-->XR-->Device-based->XR Origin and delete the Main Camera in the scene.

3. Modify the head display configuration

Select XR Origin and add the PXR_Manager component through the "Add Component" button below. This component is used to control the rendering of the head display, as well as the legality check of applications in the head display, screen gradients, etc.

4. Set up the handle model

Find the handle model prefab in the Packages/PICO Integration/Assets/Resources/Prefabs directory and select the corresponding device.

Drag and drop to the "Model Prefab" property in the XR Controller component of XR Origin > Camera Offset > LeftHand Controller. The configuration is the same for left and right hands.

 

3. Real-time preview of application scenarios

1. Enable developer mode on the pico device

        1.1 Turn on the PICO VR all-in-one machine.

        1.2 Go to Settings > General > About.

        1.3 Move the cursor to the software version number and click multiple times until the developer options appear below the left navigation bar.

        1.4 Click Developer to enter the developer options interface.

        1.5 Turn on the USB debugging switch in the upper right corner.

 2. Use the serial cable to connect the computer and the headset, open the PICO Developer Center, and the device will show that it is connected.

 

3. Open your project in the Unity editor.

Click File->Build Settings, switch to Android, select your device in RunDevice, if it doesn’t appear, press Refresh on the right to refresh it.

 4. Then click the play button above the scene, and the streaming authorization window will pop up on the headset: click Allow, and the headset will display the application screen simultaneously.

Guess you like

Origin blog.csdn.net/L0218_7225/article/details/132110932