1. Home
  2. Docs
  3. Unity SDK
  4. Unity Templates
  5. Configuration
  6. Unity Templates: The Platform Object

Unity Templates: The Platform Object

All Motive templates include a Platform object. This is where any platform-specific settings are configured, and is the first place you should look if you’re hoping to extend the core platform features with your own implementations.

Configurable Fields

First, let’s take a look at the configurable fields that are exposed in Unity:


inspector

Use Encryption, Encryption Key, Encryption IV

By default, Motive stores all user state (progress, inventory, wallet) in clear text files. If you enable encryption, Motive will store this data in encrypted files using the input key and vector as initialization parameters for DES encryption (detailsĀ here).

 

Use Native Downloader

The media downloader is slow in Unity. When Motive native plugins are included in your project (premium feature), Motive will use native implementations for downloading media. We have measured 50% or better gains in download speed with this option set.

Enable Background Location/Audio

Motive premium templates with native plugins can use background location and audio. This is not supported by default in Unity. This is great for walking tour-style apps that need to deliver an experience even when the phone screen is off.

Enable Notifications

When enabled, playable content with “Notification” will schedule system notifications when the app isn’t running. This is great for reminders, timed messages that feel like they’re coming from game characters, etc. (premium feature).

Enable Beacons

Enables iBeacon support on premium beacon-enabled templates.

Compass Type

Motive supports a few different compass implementations. You can choose which implementation your app will use:

System

System compass readings come directly from the compass sensor on the device.

Noise Reduced

Readings from the system compass with a noise filter applied to reduce jitter.

Location Tracker

Headings from the Location Tracker compass are based on GPS readings. Not too useful on its own, but valuable as part of the hybrid compass.

Hybrid

The hybrid compass combines the noise reduced and location tracker compasses. When the app is in the foreground, the noise reduced compass is used; in the background, it uses the location tracker. The hybrid compass solves the problem of computing a player’s heading when the app is in the background. Generally people pocket their phone when they aren’t looking at the screen, so the system compass can’t be relied on.

Extensibility

The following features managed by the Platform object can be overridden by your own implementation.

Storage

Motive components storage managers (Motive.Core.Storage.IStorageManager) and storage agents (Motive.Core.Storage.IStorageAgent) to persist data and maintain state. These can be replaced with your own implementation. The encrypted storage managers are implemented by EncryptedFileStorageAgent, which is managed by EncryptedFileStorageManager, which is created by StorageManager, which takes the encryption parameters from the Platform object above. You can create your own IStorageManager to implement your own storage strategy.

Compass (Motive.AR.LocationServices.ICompass)

Location Manager (Motive.AR.LocationServices.ILocationManager)

The Location Manager serves GPS data to Motive. For example, you could create your own implementation of ILocationManager to take advantage of 3rd party indoor positioning services.

Beacon Manager (Motive.AR.Beacons.IBeaconManager)

Beacon Manager manages tracking for iBeacons.

Audio Player Channel (Motive.Core.Media.IAudioPlayerChannel)

The audio player channel is used by various system elements to play audio. In premium templates, Motive uses a native implementation that allows audio to play in the background. You could override this class to use your own audio layer.

Spatial Audio Player Channel (Motive.Core.Media.ISpatialAudioPlayerChannel)

The spatial audio player channel is used for GPS-positioned binaural sound. Create your own implementation of this class to take advantage of advanced positional sound engines.

Was this article helpful to you? Yes No

How can we help?