Haptic Api Wrapper

In the HapticApiWrapper you have access to methods:

Init - this method initializes API:

public static bool InitApi();

Return true if success.

You can only init it once.

Example:

if (!HapticApiWrapper.InitApi())
{
    Debug.Log("failed to init!");
}
else
{
    Debug.Log("API init success!");
}

Close - this method closes API:

public static bool CloseApi();

Example:

void OnDestroy()
{
    HapticApiWrapper.CloseApi();
}

Dispatch - for working communication with HapxLab application:

public static void Dispatch();

This call have to be added in Update loop.

Example:

void Update()
{
    HapticApiWrapper.Dispatch();
}

Read Gestures - gives array of probability for gestures :

public static Gestures ReadGestures();

Example:

var gestures = HapticApiWrapper.ReadGestures();
Debug.Log(gestures);

Register Collider - adds ICollider from API:

public static void RegisterCollider(IHapticCollision item);

Unregister Collider - removes Collider from API:

public static void UnregisterCollider(IHapticCollision item);