#
Getting started tutorial
#
Prerequisites
- A succesfully mapped space and map id.
- Unity version 2022.3 LTS.
- Tools for building for iOS or Android.
This tutorial assumes prior experience with building mobile applications with Unity.
#
Unity
#
New project
Create a new Unity project using the default 3D project template.
#
Installation
- Open up the Package Manager from Window > Package Manager
- Click the + button and select "Add package from Git URL"
- Copy & paste the package URL below and click Add
Package URL: https://github.com/immersal/imdk-unity.git
If you see a Unity pop-up about "This project is using the new input system package but the native platform backends for the new input system are not enabled in the player settings.", please select Yes and let Unity restart before continuing.
#
Configure your Unity project
If adding the package was successful, you should automatically see a "Immersal Project Validation" pop-up window appear. This window displays Immersal specific project settings that need to be validated to ensure the SDK works as expected.
Project configurations are platform-specific, so let's switch to whatever platform we want to use first:
- Open up File > Build Settings
- Select Android or iOS as the Platform and click Switch Platform
After switching platforms, we can go back to the Project Validation window to fix possible issues:
- Focus the Project Validation window or open it again from Immersal SDK > Project Validation
- Click Fix all.
Enabling of XR Plugin Providers must be done manually as Unity does not allow configuring these automatically. Click the Fix button to open up the relevant Project Settings view and enable the checkbox next to the relevant XR Plugin Provider.
If there are any issues remaining or you want to know more, please refer to the Project Configuration page.
#
Simple sample
We provide a few samples that work well as a starting point for projects.
- Open up the Package Manager from Window > Package Manager
- Find the Immersal Core package
- Switch to the Samples tab
- Click Import next to the Core Samples option
- Open "SimpleSample" in Assets/Samples/Immersal SDK Core/2.0.0/Core Samples/Scenes/
If you see a TMP Importer pop-up, please click the "Import TMP Essentials" button before continuing.
#
Login with Immersal
For the next steps, we'll need to configure our developer token.
- Open up Immersal SDK Settings from the Immersal SDK toolbar menu.
- Log in with your credentials.
- Ensure your developer token was added to the Immersal SDK object in the scene.
#
Set up your map
Next we're going to configure the Immersal XR Map object to point to the map you've created earlier.
- Find the XR Space object in the Hierarchy
- Under it should be an XR Map object
- In the Inspector, look for the "Download from cloud" section
- Add your map id to the field
- Select both Mapfile and Visualization as download options
- Click the Download button
- After the download completes, you should see new configuration options for the XR Map.
- Click on the Select visualization button to select the point cloud visualization object.
- Set Render Mode to "Editor And Runtime".
#
Adding content
Time to add some content to your augmented space!
- Under the XR Space object, create a new empty object and call it "Content"
- Under the new Content object, add any 3d assets or other content
- Make sure none of your content is set to "Static" in the Inspector
- Save your scene
#
Try it out
Only thing left is to build the project and try it out.
- Open up File > Build Settings
- Add your scene to the "Scenes In Build" list if it's not there already
- Select Android or iOS as the Platform and click Switch Platform (if needed)
- Click Build
#
Android
Install the built apk like any other Unity Android project:
adb install YourTutorialResult.apk
#
iOS
Open up the built Unity-iPhone.xcodeproj in XCode, configure any signing options if necessary, choose target device and click Run.
#
Workflow Tutorial