Exemplo n.º 1
0
        void OnPanGestureStarted(InputAction.CallbackContext context)
        {
            if (m_ZoomGestureInProgress || m_PanGestureInProgress)
            {
                return;
            }

            TwoFingerDragGestureInteraction interaction = context.interaction as TwoFingerDragGestureInteraction;

            if (interaction?.currentGesture != null)
            {
                TwoFingerDragGesture dragGesture = interaction?.currentGesture as TwoFingerDragGesture;
                m_PanGestureInProgress  = true;
                dragGesture.onFinished += OnPanGestureFinished;
            }
        }
        void OnPanGestureStarted(InputAction.CallbackContext context)
        {
            if (m_ZoomGestureInProgress || m_PanGestureInProgress)
            {
                return;
            }

            TwoFingerDragGestureInteraction interaction = context.interaction as TwoFingerDragGestureInteraction;

            if (interaction?.currentGesture != null)
            {
                TwoFingerDragGesture dragGesture = interaction?.currentGesture as TwoFingerDragGesture;
                m_PanGestureInProgress  = true;
                dragGesture.onFinished += OnPanGestureFinished;

                Vector2 pos = Pointer.current.position.ReadValue();
                m_Camera.PanStart(pos);
            }
        }