C# code: JSON data parsing
Official website documentation:
https://doc.ximmerse.com/sdkconf/unityxrsdk/index.html
1. Environmental preparation
1. Unity environment preparation
-
Configure adb environment
Download from official website: https://developer.android.google.cn/studio/releases/platform-tools
Find SDK Platform-Tools download
Refer to this tutorial to configure adb environment variables
-
Create a new unity project that meets the version requirements and check to install the Android module. The currently tested supported versions are: 2019.4, 2020.3, 2021.3
-
Note that some dependencies use default values
2. Download the SDK
Select the SDK according to the device model, for example, download the XR SDK for the Pro version.
Official website SDK download:
SDK https://developer.ximmerse.com/#/sdk?id=1
The content directory is as follows:
2. Project initialization
1. Add a plugin (select the package.json file in the directory)
2. Modify the platform to Android
3. Modify the configuration
-
Check Compute skinning in Edit->Project Settings->Player->Other Setting
-
In Edit->Project Settings->Player->Other Setting, change Active Input Handling to Both. This operation needs to restart the project to take effect.
-
After restarting the project, click the menu item Ximmerse XR SDK->Initialize XR SDK to initialize the SDK
-
Select Ximmerse XR Loader in Asset->XR->Loader, and set it as shown below
-
Click Edit->Player Settings ->XR Plug-in Management, check Ximmerse XR Plugin.
**4. Check Java dependencies
Set the Android version above 26, otherwise the API will be reported as outdated.
Use the default java dependency package path.
If there are caches of multiple Java versions in the system that cause compilation errors, you can consider changing the compilation path, or deleting the original gradle file and the android file
3. Example project
1. Expand the sample of the plug-in, and check the Load Hello Unity sample project.
2. Select the example scene and supplement the resource pack
3. Import support plug-ins
Enter com.unity.xr.interaction.toolkit to import the starter assets plugin
4. Mount the left and right handle models separately
5. Plug in the device for debugging.
In the example project,
the left hand controls the movement of the red line,
the right hand controls the rotation of the viewing angle, and
pulling the trigger button can perform click and adsorption interaction.