You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
You are viewing the article in preview mode. It is not live at the moment.
Home > Developers > PIXO Platform Unity SDK > Installation and Overview
Installation and Overview
print icon

Overview: The Apex Unity SDK implements the PIXO Platform API, supporting Unity 2020.1 Communication to the server uses REST https JSON requests which follow the xAPI Standard.


Installing the Unity Package

  1. To install the Unity SDK, open Window > Package Manager

  2. Click the "+" in the top left corner and select "Add package from disk..."

  3. Navigate to where you've extracted the downloaded zip file and select package.json

  4. Now you should be able to see the package in the Package Manager, where you can install it into your project.

Using the Apex SDK

After installing the Apex Unity SDK, navigate to Runtime > Unity. Add the ApexSystem script to any object in the scene. Any object that the ApexSystem script is added to will NOT be deleted between level changes.

 

The ApexSystem is a singleton, all functions are wrapped in static functions to make the use simpler. If you want access to the response events in code, you will need to access the ApexSystem Instance. Example:

ApexSystem.Instance.OnPingSuccess.AddListener(YourFunctionHere);

Requirements for Building with the Apex SDK

The project's API Compatibility Level needs to be .NET 4.x or newer.

Important ApexSystem Variables

There are several variables in ApexSystem that you need to set for data reporting to work properly:

  • ServerIP (optional): The Apex server IP address that you want to send the information to. By default it will point to our production environment, and in most cases you shouldn't need to change it.
  • ModuleID: The ID of the module that will be distributed to customers. PIXO will provide this ID for you when your module is initially set up on the PIXO Platform. This variable must be set for the data to be reported to the proper module.
  • ModuleName: The name of your module.
  • ModuleVersion: The version number of your module currently on the Platform. Please update the version number every time you prepare a new build for the Platform.
  • ScenarioID: The name of the current scenario within your module that the user is taking part in. You can have multiple scenarios within a module. This variable needs to be updated every time a user enters a new scenario.

Understanding xAPI and TinCan.NET

Data sent to the PIXO Platform is formatted using the xAPI Standard. The Unity SDK utilizes TinCan.NET to ensure all data is xAPI Compliant.

  • To understand how TinCan.NET is used, visit the documentation here
  • To get a better understanding of the xAPI Standard, visit the xAPI Spec here

Quick Function Explanations

All server functions have corresponding Success and Failed events.

Ping()

Contacts the Apex Server for status:

  • OnPingSuccess is called when there is a successful response from the server.
  • OnPingFailed is called when the server is not able to be reached.

Authentication Functions

There are 2 different functions that can be used for authentication. They are explained in more detail in the Authentication section of this documentation.

Login(login : LoginData) : Boolean
Login(username : string, password : string) : Boolean

Data Reporting Functions

There are 4 data reporting functions available. They are explained in more detail in their individual Data Reporting articles:

Integrating with ManageXR

The PIXO platform provides a way to integrate with the ManageXR platform. Follow the steps below to integrate with ManageXR:

 

1. Go to your project manifest json file located at Packages/manifest.json. Add this line to your dependency list:

"com.mxr.unity.sdk":"https://www.github.com/ManageXR/mxr-unity-sdk.git#VERSION"

The VERSION is the SDK version you want to install. For example, if you want to install version v1.0.15, the line should be:

"com.mxr.unity.sdk":"https://www.github.com/ManageXR/mxr-unity-sdk.git#v1.0.15"

2. Next, open your Unity project and go to Edit > Project Settings > Player.

 

3. Select the Android platform and go to Other Settings > Script Compilation.

 

4. Add MANAGE_XR to the Scripting Define Symbols and press Apply. This is case sensitive.

 

5. Make sure you do not call await MXRManager.InitAsync(); in any of your scripts. This is called by the Apex Unity SDK.


Next Article: PIXO Platform Integration Requirements

Feedback
0 out of 0 found this helpful

scroll to top icon