public static void DisableGesture(Constants.Commands.GesturesEnum gesture) { if (gesture == Constants.Commands.GesturesEnum.RoomScreenshot) { // ERROR TESTING - NEED TO ACCOUNT FOR WHEN GESTURERECOGNIZER IS EMPTY AND WHEN I CAN DESTROY / NULL IT OUT if (gestureRecognizer != null) { gestureRecognizer.StopCapturingGestures(); gestureRecognizer.TappedEvent -= GestureRecognizer_OnTappedEvent; gestureRecognizer.StartCapturingGestures(); } } else { throw new System.Exception(Constants.ErrorStrings.GestureNotFound); } }
// Gesture commands // Add event logic to the keyphrase databank // Enable Hololens to recognize and act upon certain keywords // when this script is first enabled. public static void EnableGesture(Constants.Commands.GesturesEnum gesture) { if (gesture == Constants.Commands.GesturesEnum.RoomScreenshot) { if (gestureRecognizer == null) { gestureRecognizer = new GestureRecognizer(); } else { gestureRecognizer.StopCapturingGestures(); } gestureRecognizer.TappedEvent += GestureRecognizer_OnTappedEvent; gestureRecognizer.StartCapturingGestures(); } else { throw new System.Exception(Constants.ErrorStrings.GestureNotFound); } }