I have been trying to implement the standard gestures leap motion provides such as the circle gesture and swipe gesture but none of them seems to work. I'm having a hard time understanding why most method that exists in the API are not being recognised in Unity.
Below is code I have used to get a circle gesture.
using UnityEngine;
using System.Collections;
using Leap;
public class LeapTest : Leap.Listener {
public Leap.Controller Controller;
// Use this for initialization
public void Start () {
Controller = new Leap.Controller(this);
Debug.Log("Leap start");
}
public override void OnConnect(Controller controller){
Debug.Log("Leap Connected");
controller.EnableGesture(Gesture.GestureType.TYPECIRCLE,true);
}
public override void OnFrame(Controller controller)
{
Frame frame = controller.Frame();
GestureList gestures = frame.Gestures();
for (int i = 0; i < gestures.Count; i++)
{
Gesture gesture = gestures[0];
switch(gesture.Type){
case Gesture.GestureType.TYPECIRCLE:
Debug.Log("Circle");
break;
default:
Debug.Log("Bad gesture type");
break;
}
}
However, when I put this code into unity3D it doesn't recognise the following lines of code from the code above:
Leap.Controller
.EnableGesture(Gesture.GestureType.TYPECIRCLE, true);
GestureList gestures = frame.Gestures();
I don't understand what I am missing out here, or is it depreciated? Please, can someone explain? Thankyou