Import SDK and configuration items
The PANCAKE Unity SDK is based on the development tools provided by Unity XR, which contains the functions, components, plug-ins, and scripts required to develop PANCAKE VR applications. This document describes how to create a project in Unity Hub and then import the SDK in the project.
Step 1: Create the project
Before importing the SDK, you need to create a new project in Unity Hub. The steps are as follows:
On the Unity Hub home page, click Project > New project.
You will be taken to the New Project page.
Select Core template > 3D.
In the Project settings area, set the project name and storage directory.
==Note==
Project name [1] and storage directory [2] Chinese characters cannot be included.Click Create a project.
Once the project is initialized, you will be taken to the Unity Editor page.
Step 2: Import the PANCAKE Unity SDK.
To Developer Platform SDK Page download the latest version of the SDK.
Unzip the downloaded SDK archive. You will get an SDK folder containing the.tgz file, which will be imported and used directly in the Unity Package Manager without extracting it.
Return to Unity Editor page..
In the upper menu bar, select Windows > Package Manager.
In the Package Manager window, click + > Add package from tarball..
Select the com.svr.openxr-1.0.0.tgz file and import it.
Step 3: Configure the project
Enable the PANCAKE XR plug-in to tap into the XR capabilities provided by the SDK within your application. The steps are as follows:
Select File > Build Setting from the upper menu bar, and switch the project to the Android platform in the Build Setting interface.
From the upper menu bar, select Edit > Project Settings.
In the Project Settings window, click XR Plug-in Management the > Android Settings icon and check OpenXR.
If an error is prompted after checking, click Fix All to solve it.
Check the OpenXR settings again
Add Oculus Touch Controller Profile and check SXR Runtime by step.
Set package name and version number
Package name is one of the important identifiers used to identify Android applications, and the format is com. CompanyName. ProductName. When you export an APK file, the Unity editor automatically populates the Android Manifest file with the company and product names based on your settings. The version number is used to show the user the specific version of the application. Make sure that the new version number is higher than the current version number before each release of the application. Follow these steps to modify the application package name and version number.
a. In the Project Settings window, click on the Player left navigation bar.
b. At the Player panel, set Company Name, Product Name and Version.
Once the setup is complete, do not exit the Player settings panel, which we will use to complete other settings.
Complete other settings
Other settings mainly affect the basic compilation mode of the application and the version of the supporting system. To successfully develop the PANCAKE VR application, the following settings need to be completed:
· Minimum API Level: Set the minimum Android SDK version required for the app to run. The minimum Android SDK version supported by the PANCAKE Unity SDK plug-in is 10.0 (i.e. API level 29). If it is lower than this version, an error may be reported when building the application.
· Target API Level: Set the target Android SDK version used to compile the application. The selected version must be equal to or higher than the minimum Android SDK version, otherwise an error will be reported.
· Scripting Backend: Set the compilation mode of C # code in the project.
· Target Architectures: Set the running environment (i.e. CPU) of the application.
(Optional) Configure the Android manifest file
Since the PANCAKE VR device is based on Android, any application running on the device must include an Android manifest file (Android Manifest. XML). This file contains important meta-information of Android applications, including configuration information, permissions, software and hardware support, Android version support, etc. If the Unity engine is used to generate the PANCAKE VR application, the Android manifest file will be automatically generated in the APK file. Based on your app configuration, the corresponding configuration content will be automatically generated in the Android manifest file. For example, when you configure an app's Internet Access capabilities in the Unity editor, the corresponding configuration metadata is automatically added to the Android manifest file. Therefore, you don't need to manually add anything to the file, just compile and run it.
If you want to customize the Android manifest file, you can go to Edit > Project Settings > Player Publishing Settings > > Build and check Custom Main Manifest it.After checking, the Android Manifest. XML file will be generated under the Assets/Plugins/Android path. You can open the file and add a custom configuration.
For more information about the Android manifest file, refer to Android official documentation.
Subsequent operations
Build a simple XR scenario using the instructions in the Create an XR scene.