public SetRecognizableGestures ( GestureSettings newMaskValue ) : GestureSettings | ||
newMaskValue | GestureSettings | A mask indicating which gestures are now recognizable. |
return | GestureSettings |
void Start () { recognizer = new GestureRecognizer(); recognizer.SetRecognizableGestures(GestureSettings.Tap); recognizer.TappedEvent += Recognizer_TappedEvent; recognizer.StartCapturingGestures(); }
// 仮 void Awake() { InputActionRecognizer = new UnityEngine.VR.WSA.Input.GestureRecognizer(); InputActionRecognizer.SetRecognizableGestures(UnityEngine.VR.WSA.Input.GestureSettings.Hold); InputActionRecognizer.HoldStartedEvent += InputActionRecognizer_HoldStartEvent; InputActionRecognizer.HoldCompletedEvent += InputActionRecognizer_HoldCompletedEvent; }
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(); }