// Use this for initialization void Start() { player = controller.GetLeapRecorder(); trainer = GetComponent <LeapTrainer> (); if (trainer != null) { trainer.OnEndedRecording += () => Debug.Log("OnEndedRecording"); trainer.OnGestureCreated += (name, trainingSkipped) => Debug.Log("OnGestureCreated"); trainer.OnGestureDetected += (points, frameCount) => Debug.Log("OnGestureDetected"); trainer.OnGestureRecognized += (name, value, allHits) => { Debug.Log("OnGestureRecognized"); foreach (var v in allHits) { Debug.Log(" ==> " + v.Key + " : " + v.Value); } }; trainer.OnGestureUnknown += (allHits) => { Debug.Log("OnGestureUnknown"); foreach (var v in allHits) { Debug.Log(" ==> " + v.Key + " : " + v.Value); } }; trainer.OnStartedRecording += () => Debug.Log("OnStartedRecording"); trainer.OnTrainingComplete += (name, gestures, isPose) => Debug.Log("OnTrainingComplete"); trainer.OnTrainingCountdown += (countdown) => Debug.Log("OnTrainingCountdown"); trainer.OnTrainingGestureSaved += (name, gestures) => Debug.Log("OnTrainingGestureSaved"); trainer.OnTrainingStarted += (name) => Debug.Log("OnTrainingStarted"); } }
public TrainerListener(LeapTrainer lt, Controller c) { this.lt = lt; this.c = c; c.FrameReady += OnFrame; }
public TrainerListener(LeapTrainer lt, Controller c) { this.lt = lt; this.c = c; c.AddListener(this); }