Beispiel #1
0
 // Use this for initialization
 void Start()
 {
     //Initalise flight controller
     gestureRecogniser = GetComponent <GestureRecogniser>();
     camera_           = camera2.transform;
     created_ui        = null;
 }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     //Initalise flight controller
     flyController     = new Controller();
     gestureRecogniser = GetComponent <GestureRecogniser>();
     rotateAngleX      = 0.0f;
     rotateAngleZ      = 0.0f;
 }
        private void OnTap(GestureRecogniser xGesture)
        {
            if (xGesture.State == GestureState.GestureStateRecognised)
            {
                m_currentColourIndex += 1;
                if (m_currentColourIndex >= m_coloursToCycle.Length)
                {
                    m_currentColourIndex = 0;
                }

                m_myMaterial.color = m_coloursToCycle[m_currentColourIndex];
            }
        }
Beispiel #4
0
    void Start()
    {
        if (drawnPathPrefab == null)
        {
            Debug.LogError("No DrawnPath prefab");
        }

        gesture = GetComponent <GestureRecogniser>();

        if (gesture == null)
        {
            Debug.LogError("No GestureRecogniser prefab");
        }
    }
        private void HandleLongPress(GestureRecogniser pxGesture)
        {
            GestureState kState = pxGesture.State;

            if (kState == GestureState.GestureStateChanged)
            {
                Vector3 xScreenPoint = new Vector3();
                xScreenPoint.x = pxGesture.Focus.x;
                xScreenPoint.y = pxGesture.Focus.y;
                xScreenPoint.z = m_distanceFromCamera;

                Vector3 xWorldPoint = m_camera.ScreenToWorldPoint(xScreenPoint);

                m_transform.position = xWorldPoint;
            }
        }
        private void HandleSwipe(GestureRecogniser pxGesture)
        {
            if (pxGesture.State == GestureState.GestureStateRecognised)
            {
                SwipeGestureRecogniser pxSwipeGesture = (SwipeGestureRecogniser)pxGesture;

                Vector2 pxSwipeVelocity = pxSwipeGesture.Velocity;
                pxSwipeVelocity /= m_fSwipeVelocityScaleFactor;

                Vector3 pxVelocityForce = Vector3.zero;
                pxVelocityForce.x = pxSwipeVelocity.x;
                pxVelocityForce.y = 0.0f;
                pxVelocityForce.z = pxSwipeVelocity.y;

                m_pxRigidbody.AddForce(pxVelocityForce);
            }
        }
        private void HandleSwipe( GestureRecogniser pxGesture )
        {
            if ( pxGesture.State == GestureState.GestureStateRecognised )
            {
                SwipeGestureRecogniser pxSwipeGesture = (SwipeGestureRecogniser)pxGesture;

                Vector2 pxSwipeVelocity = pxSwipeGesture.Velocity;
                pxSwipeVelocity /= m_fSwipeVelocityScaleFactor;

                Vector3 pxVelocityForce = Vector3.zero;
                pxVelocityForce.x = pxSwipeVelocity.x;
                pxVelocityForce.y = 0.0f;
                pxVelocityForce.z = pxSwipeVelocity.y;

                m_pxRigidbody.AddForce( pxVelocityForce );
            }
        }
 // Use this for initialization
 void Start()
 {
     gestureRecogniser = GetComponent <GestureRecogniser>();
 }