Integrating the Unity Package

Add the ARwayKit Unity package to an existing Unity Project

If you have an existing Unity app follow these steps to add the .unitypackage. Otherwise, we recommend that you build from the source:

Building from the Source Code

Get the ARwayKit SDK .unitypackage

Download the .unitypackage from our GitHub. Please contact us for access.

Prerequisites

In this guide, we will be using the following versions of Unity:

  • Unity: 2022.3.29f1 LST

    • Include the following platforms in your Unity install:

      • Android Build Support

        • OpenJDK

        • Android SDK & NDK Tools

      • iOS Build Support

Implementation

In the below instructions, we will be creating a new project in Unity, skip the step for creating a new project if you already have an existing Unity codebase.

Getting the Account ID and Secret Key

  1. From the ARway Creator Portal, go to "For Developers -> Create a New App -> Enter App Name".

  2. Copy your Account ID and SecretKey for that App.

Creating a new project in Unity

If you have an existing project in Unity, skip this step.

  1. Open Unity Hub and click the "New project" button on the top right.

  1. Select the template "3D (Built-In Render Pipeline)" and create your new project (Unity Version 2022.3.29f1).

Change Project Platform

  1. Go to "File -> Build Settings..." and select either Android or iOS and then click "Switch Platform".

Importing Packages

  1. Go to "Assets -> Import Package -> Custom Package". Then select the ARwayKit SDK .unitypackage.

  2. In the "Import Unity Package" window import the package.

  3. Next, the package setup will begin. Click "Install Packages" to install all of the required packages.

  1. Wait for the packages to install and for the scripts to compile.

  2. In the warning pop-up for enabling the backends for the input system package, select either "Yes" or "No" as it is optional for the ARwayKit SDK.

  1. Then click 'Setup SDK' to finish part 2/2 for the setup.

  1. Next, click "import" to import the project settings. Please note that this will overwrite all of your previous project settings.

  1. In the Import Unity Package window, select all and click "Next" then "Import".

Resolving Issue With No Active LocalizationSettings

If after importing the Unity Package you get an error in the console that says "There is no active LocalizationSettings", you can manually resolve this in the Player Settings. Otherwise, skip to the next step.

In the Unity Editor go to "Edit -> Project Settings", the select the "Localization" category on the left. Then if you see beside "Active Settings" the text "None (Localization Settings)" click the button to the right to select the localization settings.

Then in the new window, Localization Settings Asset. To confirm that it was selected the Available Locales will be shown in the Project Settings window.

Completing these steps will resolve the "There is no active LocalizationSettings" issue.

Adding the Scenes to the Build

  1. Open the Dashboard-SDK scene. Under in the Project tab go to "Assets -> ARWay -> ViewerMode -> 0_Scene" and double-click Dashboard-SDK.

  2. Then open "File -> Build Settings..." and click the "Add Open Scenes" button to add the scene to the build.

  1. Then do the same for ARMapSession scene "Assets -> ARWay -> ViewerMode -> 0_Scene" and double-click ARMapSession.

  2. Then open "File -> Build Settings..." and click the "Add Open Scenes" button to add the scene to the build.

  3. Now both Dashboard-SDK and ARMapSession should be in the "Scenes in Build". Ensure that Dashboard-SDK is the top scene in the build.

Adding the Account ID and Secret Key

  1. In the Project Window, go to "Assets -> ARWay -> ViewerMode -> Resources -> ARWayKitConfig
" and add your credentials for the Account ID and Secret Key.

Updating the Addressables Groups

  1. Navigate to "Window -> Asset Management -> Addressable -> Groups".

  2. In the Addressables Groups window, click on "Build -> New Build -> Default Build Script".

When making any changes that affect localization strings, you will need to update the Addressables Groups "Build -> New Build -> Default Build Script".

Building the App

  1. In Unity select "File -> Build Settings -> Build -> Select iOS/Android -> Build and Run" to run the app.

After successfully building the app on your device, you can scan QR codes that you created for your ARway maps in the Creator Portal.

Last updated