Unity API

API

Init the Evomo Sdk

Before tracking movement events, you must init the Evomo SDK. Here is an example of how you could do that using the Awake method of a script:

private void Awake()
{
Evomo.Init(EvomoReady, "licenseID"); // Insert your licenseID as string
}
private void EvomoReady()
{
Debug.Log("Evomo ready to track movements!");
//Continue with setting up your game stuff
}

Track Movements

Before you start tracking movements, you should subscribe to the events that you are interested in.

here is a simple example:

private void SubscribeToEvomoEvents()
{
Evomo.OnLeft.AddListener(OnLeft);
Evomo.OnRight.AddListener(OnRight);
Evomo.OnJump.AddListener(OnJump);
Evomo.OnDuck.AddListener(OnDuck);
}
private void OnLeft()
{
//move character left
}
private void OnRight()
{
//move character right
}
private void OnJump()
{
//make character jump
}
private void OnDuck()
{
//make character duck
}

To start and stop tracking movements, use the following methods:

Evomo.StartTracking();
// use this option to define device orientation - default is buttonDown means Portrait mode with home button pointing to the ground
Evomo.StartTracking(deviceOrientation: Evomo.DeviceOrientation.buttonRight);
// use this option to define a specific classification model - default is "2115"
Evomo.StartTracking(classificationModel: "2115");
Evomo.StopTracking();

Log events

// Log custom events
// public static void LogEvent(string eventType, string note = "")
Evomo.LogEvent(eventType: "something", note:"")
// Log when movements should executed/classified
// public static void LogTargetMovement(MovementType movementType, string note = "")
Evomo.LogTargetMovement(movementType: Evomo.MovementType.jump, note: "sth")
// Log for failures
// FailureType - toLess means the movement was missing - toMuch means a movement was classified where no movement was needed
// public static void LogFailure(EventSource source, FailureType failureType, MovementType movementType, string note = "")
Evomo.LogTargetMovement(source: Evomo.EventSource.app, failureType: Evomo.FailureType.toLess, movementType: Evomo.MovementType.jump, note: "sth")