[Unity] Suiguang MR device access minimalist tutorial


Official website documentation:
https://doc.ximmerse.com/sdkconf/unityxrsdk/index.html

1. Environmental preparation

1. Unity environment preparation

  1. 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
    insert image description here

  2. 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

  3. Note that some dependencies use default values
    insert image description here

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:
insert image description here

2. Project initialization

1. Add a plugin (select the package.json file in the directory)

insert image description here

2. Modify the platform to Android

insert image description here

3. Modify the configuration

  1. Check Compute skinning in Edit->Project Settings->Player->Other Setting
    insert image description here

  2. In Edit->Project Settings->Player->Other Setting, change Active Input Handling to Both. This operation needs to restart the project to take effect.
    insert image description here

  3. After restarting the project, click the menu item Ximmerse XR SDK->Initialize XR SDK to initialize the SDK
    insert image description here

  4. Select Ximmerse XR Loader in Asset->XR->Loader, and set it as shown below
    insert image description here

  5. Click Edit->Player Settings ->XR Plug-in Management, check Ximmerse XR Plugin.
    insert image description here

**4. Check Java dependencies

Set the Android version above 26, otherwise the API will be reported as outdated.

insert image description here
Use the default java dependency package path.

insert image description here
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

insert image description here

3. Example project

1. Expand the sample of the plug-in, and check the Load Hello Unity sample project.

insert image description here

2. Select the example scene and supplement the resource pack

insert image description here

insert image description here

3. Import support plug-ins

Enter com.unity.xr.interaction.toolkit to import the starter assets plugin

insert image description here

4. Mount the left and right handle models separately

insert image description here
insert image description here

5. Plug in the device for debugging.

insert image description here

insert image description here

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.

Guess you like

Origin blog.csdn.net/qq_35079107/article/details/131104344