GestureTracker Coding Sample

This is a sample using Eskin GestureTracker class for Unity.

API Reference:
https://developer.xenoma.com/documentation/apis/html/fa8a3afc-8ddc-7add-64fe-90de3f6ec69a.htm

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ESkin.Unity;
using ESkin.Gesture;

public class Sample : MonoBehaviour {

    UnityESkinSensor sensor;
    GestureTracker gestureTracker;

    void Start () {
        sensor = SensorManager.Instance.Sensor;
        gestureTracker = new GestureTracker (sensor);
        gestureTracker.OnJabbedLeft += gestureTracker_OnJabbedLeft;
        gestureTracker.OnJabbedRight += gestureTracker_OnJabbedRight;
        gestureTracker.OnStartedRunning += gestureTracker_OnStartedRunning;
        gestureTracker.OnRunning += gestureTracker_OnRunning;
        gestureTracker.OnStoppedRunning += gestureTracker_OnStoppedRunning;
    }

    void Update () {
    }

    // Callback e-skin GestureTracker Event
    void gestureTracker_OnJabbedLeft(object sendor, EventArgs e) {
    }
    void gestureTracker_OnJabbedRight(object sendor, EventArgs e) {
    }
    void gestureTracker_OnStartedRunning(object sendor, EventArgs e) {
    }
    void gestureTracker_OnRunning(object sendor, EventArgs e) {
    }
    void gestureTracker_OnStoppedRunning(object sendor, EventArgs e) {
    }

    void OnDestroy() {
        gestureTracker.OnJabbedLeft -= gestureTracker_OnJabbedLeft;
        gestureTracker.OnJabbedRight -= gestureTracker_OnJabbedRight;
        gestureTracker.OnStartedRunning -= gestureTracker_OnStartedRunning;
        gestureTracker.OnRunning -= gestureTracker_OnRunning;
        gestureTracker.OnStoppedRunning -= gestureTracker_OnStoppedRunning;
    }
}