public void OnGestureCompleted(GestureCompletedArgs e) { gestureEvents.AddRange(e.Events); gestureCount++; if (gestureCount >= pipeThreads.Count && gestureEvents.Count > 0) { //#if (DEBUG) // foreach (GestureEvent s in gestureEvents) // { // Console.WriteLine("[Event] " + s.Type); // } //#endif unityInterface.Invoke(new UnityModuleArgs(gestureEvents)); gestureEvents.Clear(); gestureCount = 0; } }
public void DoWork(GestureModuleArgs e) { // Run the gesture module on the given Players List<GestureEvent> events = this.gestureModule.processPlayers(e.Players); //List<GestureEvent> events = new List<GestureEvent>(); //events.Add(new GestureEvent("Testing")); GestureCompletedArgs args = new GestureCompletedArgs(events); //invoke main thread to send back gesture info completed.BeginInvoke(args, null, null); }