/// <summary> /// The Unity Update() method. /// </summary> public void Update() { DragGestureRecognizer.Update(); PinchGestureRecognizer.Update(); TwoFingerDragGestureRecognizer.Update(); TapGestureRecognizer.Update(); TwistGestureRecognizer.Update(); }
/// <summary> /// The Unity Awake() method. /// </summary> public void Awake() { _InitializeSingleton(); DragGestureRecognizer = new DragGestureRecognizer(); PinchGestureRecognizer = new PinchGestureRecognizer(); TwoFingerDragGestureRecognizer = new TwoFingerDragGestureRecognizer(); TapGestureRecognizer = new TapGestureRecognizer(); TwistGestureRecognizer = new TwistGestureRecognizer(); }
/// <summary> /// The Unity Update() method. /// </summary> public void Update() { if (canManipulate) { TapGestureRecognizer.Update(); DragGestureRecognizer.Update(); PinchGestureRecognizer.Update(); TwoFingerDragGestureRecognizer.Update(); TwistGestureRecognizer.Update(); } }
/// <summary> /// The Unity Update() method. /// </summary> public void Update() { if (j == 0) { DragGestureRecognizer.Update(); //PinchGestureRecognizer.Update(); //TwoFingerDragGestureRecognizer.Update(); TapGestureRecognizer.Update(); TwistGestureRecognizer.Update(); } }
private void ConnectToRecognizers() { if (SceneManager.GetActiveScene().name != "ARManipulation") { Debug.Log("Scene is not ARManipulation. Halt manipulator script"); return; } if (ManipulationSystem.Instance == null) { Debug.LogError("Manipulation system not found in scene."); return; } DragGestureRecognizer dragGestureRecognizer = ManipulationSystem.Instance.DragGestureRecognizer; if (dragGestureRecognizer != null) { dragGestureRecognizer.onGestureStarted += OnGestureStarted; } PinchGestureRecognizer pinchGestureRecognizer = ManipulationSystem.Instance.PinchGestureRecognizer; if (pinchGestureRecognizer != null) { pinchGestureRecognizer.onGestureStarted += OnGestureStarted; } TapGestureRecognizer tapGestureRecognizer = ManipulationSystem.Instance.TapGestureRecognizer; if (tapGestureRecognizer != null) { tapGestureRecognizer.onGestureStarted += OnGestureStarted; } TwistGestureRecognizer twistGestureRecognizer = ManipulationSystem.Instance.TwistGestureRecognizer; if (twistGestureRecognizer != null) { twistGestureRecognizer.onGestureStarted += OnGestureStarted; } TwoFingerDragGestureRecognizer twoFingerDragGestureRecognizer = ManipulationSystem.Instance.TwoFingerDragGestureRecognizer; if (twoFingerDragGestureRecognizer != null) { twoFingerDragGestureRecognizer.onGestureStarted += OnGestureStarted; } }
/// <summary> /// The Unity Update() method. /// </summary> public void Update() { //If tap was on UI, ignore tap if (IsPointerOverUIObject()) { return; } DragGestureRecognizer.Update(); PinchGestureRecognizer.Update(); TwoFingerDragGestureRecognizer.Update(); TapGestureRecognizer.Update(); TwistGestureRecognizer.Update(); }
private void DisconnectFromRecognizers() { if (ManipulationSystem.Instance == null) { Debug.LogError("Manipulation system not found in scene."); return; return; } DragGestureRecognizer dragGestureRecognizer = ManipulationSystem.Instance.DragGestureRecognizer; if (dragGestureRecognizer != null) { dragGestureRecognizer.onGestureStarted -= OnGestureStarted; } PinchGestureRecognizer pinchGestureRecognizer = ManipulationSystem.Instance.PinchGestureRecognizer; if (pinchGestureRecognizer != null) { pinchGestureRecognizer.onGestureStarted -= OnGestureStarted; } TapGestureRecognizer tapGestureRecognizer = ManipulationSystem.Instance.TapGestureRecognizer; if (tapGestureRecognizer != null) { tapGestureRecognizer.onGestureStarted -= OnGestureStarted; } TwistGestureRecognizer twistGestureRecognizer = ManipulationSystem.Instance.TwistGestureRecognizer; if (twistGestureRecognizer != null) { twistGestureRecognizer.onGestureStarted -= OnGestureStarted; } TwoFingerDragGestureRecognizer twoFingerDragGestureRecognizer = ManipulationSystem.Instance.TwoFingerDragGestureRecognizer; if (twoFingerDragGestureRecognizer != null) { twoFingerDragGestureRecognizer.onGestureStarted -= OnGestureStarted; } }
private void ConnectToRecognizers() { if (ManipulationSystem.Instance == null) { Debug.LogError("Manipulation system not found in scene."); return; } DragGestureRecognizer dragGestureRecognizer = ManipulationSystem.Instance.DragGestureRecognizer; if (dragGestureRecognizer != null) { dragGestureRecognizer.onGestureStarted += OnGestureStarted; } //PinchGestureRecognizer pinchGestureRecognizer = // ManipulationSystem.Instance.PinchGestureRecognizer; //if (pinchGestureRecognizer != null) //{ // pinchGestureRecognizer.onGestureStarted += OnGestureStarted; //} TapGestureRecognizer tapGestureRecognizer = ManipulationSystem.Instance.TapGestureRecognizer; if (tapGestureRecognizer != null) { tapGestureRecognizer.onGestureStarted += OnGestureStarted; } TwistGestureRecognizer twistGestureRecognizer = ManipulationSystem.Instance.TwistGestureRecognizer; if (twistGestureRecognizer != null) { twistGestureRecognizer.onGestureStarted += OnGestureStarted; } //TwoFingerDragGestureRecognizer twoFingerDragGestureRecognizer = // ManipulationSystem.Instance.TwoFingerDragGestureRecognizer; //if (twoFingerDragGestureRecognizer != null) //{ // twoFingerDragGestureRecognizer.onGestureStarted += OnGestureStarted; //} }
/// <summary> /// Constructs a DragGesture gesture. /// </summary> /// <param name="recognizer">The gesture recognizer.</param> /// <param name="touch">The touch that started this gesture.</param> public DragGesture(DragGestureRecognizer recognizer, Touch touch) : base(recognizer) { FingerId = touch.fingerId; StartPosition = touch.position; Position = StartPosition; }