// Use this for initialization void Start() { // Set up a GestureRecognizer to detect Select gestures. gestureRecognizer = new GestureRecognizer(); gestureRecognizer.TappedEvent += GestureRecognizer_TappedEvent; gestureRecognizer.StartCapturingGestures(); }
// Use this for initialization void Start() { // Set up a GestureRecognizer to detect Select gestures. gestureRecognizer = new UnityEngine.VR.WSA.Input.GestureRecognizer(); gestureRecognizer.TappedEvent += GestureRecognizer_TappedEvent; gestureRecognizer.StartCapturingGestures(); }
private void Transition(MRWSAInput.GestureRecognizer newRecognizer) { if (newRecognizer != null && this.activeRecognizer == newRecognizer && this.IsCapturingGestures) { return; } if (this.activeRecognizer != null) { if (this.activeRecognizer == newRecognizer) { return; } this.activeRecognizer.CancelGestures(); this.activeRecognizer.StopCapturingGestures(); } if (newRecognizer != null) { newRecognizer.StartCapturingGestures(); } this.activeRecognizer = newRecognizer; }
void Start () { recognizer = new GestureRecognizer(); recognizer.SetRecognizableGestures(GestureSettings.Tap); recognizer.TappedEvent += Recognizer_TappedEvent; recognizer.StartCapturingGestures(); }
// Use this for initialization void Start() { Instance = this; // Set up a GestureRecognizer to detect Select gestures. recognizer = new GestureRecognizer(); recognizer.TappedEvent += Recognizer_TappedEvent; recognizer.StartCapturingGestures(); }
// Use this for initialization void Start() { Instance = this; this.recognizer = new GestureRecognizer(); recognizer.TappedEvent += (source, tapCount, ray) => { if (FocusedObject != null) { FocusedObject.SendMessageUpwards("OnSelect"); } }; recognizer.StartCapturingGestures(); }
// Use this for initialization void Start() { Instance = this; // Set up a GestureRecognizer to detect Select gestures. recognizer = new GestureRecognizer(); recognizer.TappedEvent += (source, tapCount, ray) => { // Send an OnSelect message to the focused object and its ancestors. if (FocusedObject != null) { FocusedObject.SendMessageUpwards("OnSelect"); } }; recognizer.StartCapturingGestures(); }
private void Awake() { #if UNITY_EDITOR // If we are running inside Unity's Editor, disable the Fitbox script // as there is no easy way to dismiss it to see our actual holograms. enabled = false; #else // UNITY_EDITOR // These are the holograms to show when the Fitbox is dismissed if (HologramCollection) { collectionStartingOffsetFromCamera = HologramCollection.transform.localPosition; HologramCollection.SetActive(false); } // Set up our GestureRecognizer to listen for the SelectEvent recognizer = new GestureRecognizer(); recognizer.TappedEvent += (source, tapCount, ray) => { DismissFitbox(); }; recognizer.StartCapturingGestures(); #endif }
private void Awake() { gestureRecognizer = new GestureRecognizer(); gestureRecognizer.TappedEvent += OnTappedEvent; gestureRecognizer.HoldStartedEvent += OnHoldStartedEvent; gestureRecognizer.HoldCompletedEvent += OnHoldCompletedEvent; gestureRecognizer.HoldCanceledEvent += OnHoldCanceledEvent; gestureRecognizer.ManipulationStartedEvent += OnManipulationStartedEvent; gestureRecognizer.ManipulationUpdatedEvent += OnManipulationUpdatedEvent; gestureRecognizer.ManipulationCompletedEvent += OnManipulationCompletedEvent; gestureRecognizer.ManipulationCanceledEvent += OnManipulationCanceledEvent; gestureRecognizer.SetRecognizableGestures(GestureSettings.Tap | GestureSettings.ManipulationTranslate | GestureSettings.Hold); gestureRecognizer.StartCapturingGestures(); // We need a separate gesture recognizer for navigation, since it isn't compatible with manipulation navigationGestureRecognizer = new GestureRecognizer(); navigationGestureRecognizer.NavigationStartedEvent += OnNavigationStartedEvent; navigationGestureRecognizer.NavigationUpdatedEvent += OnNavigationUpdatedEvent; navigationGestureRecognizer.NavigationCompletedEvent += OnNavigationCompletedEvent; navigationGestureRecognizer.NavigationCanceledEvent += OnNavigationCanceledEvent; if (UseRailsNavigation) { navigationGestureRecognizer.SetRecognizableGestures(GestureSettings.NavigationRailsX | GestureSettings.NavigationRailsY | GestureSettings.NavigationRailsZ); } else { navigationGestureRecognizer.SetRecognizableGestures(GestureSettings.NavigationX | GestureSettings.NavigationY | GestureSettings.NavigationZ); } navigationGestureRecognizer.StartCapturingGestures(); }