/// <summary>
        /// Action to be performed when this gesture is started.
        /// </summary>
        protected internal override void OnStart()
        {
            GestureTouchesUtility.LockFingerId(FingerId1);
            GestureTouchesUtility.LockFingerId(FingerId2);

            RaycastHit hit1;
            RaycastHit hit2;

            if (GestureTouchesUtility.RaycastFromCamera(StartPosition1, out hit1))
            {
                var gameObject = hit1.transform.gameObject;
                if (gameObject != null)
                {
                    TargetObject = gameObject.GetComponentInParent <Manipulator>().gameObject;
                }
            }
            else if (GestureTouchesUtility.RaycastFromCamera(StartPosition2, out hit2))
            {
                var gameObject = hit2.transform.gameObject;
                if (gameObject != null)
                {
                    TargetObject = gameObject.GetComponentInParent <Manipulator>().gameObject;
                }
            }

            Touch touch1;

            GestureTouchesUtility.TryFindTouch(FingerId1, out touch1);
            Touch touch2;

            GestureTouchesUtility.TryFindTouch(FingerId2, out touch2);
            Position = (touch1.position + touch2.position) / 2;
        }
Exemple #2
0
        /// <summary>
        /// Action to be performed when this gesture is started.
        /// </summary>
        protected internal override void OnStart()
        {
            GestureTouchesUtility.LockFingerId(FingerId1);
            GestureTouchesUtility.LockFingerId(FingerId2);

            Touch touch1, touch2;
            GestureTouchesUtility.TryFindTouch(FingerId1, out touch1);
            GestureTouchesUtility.TryFindTouch(FingerId2, out touch2);
            m_PreviousPosition1 = touch1.position;
            m_PreviousPosition2 = touch2.position;
        }
Exemple #3
0
        /// <summary>
        /// Action to be performed when this gesture is started.
        /// </summary>
        protected internal override void OnStart()
        {
            GestureTouchesUtility.LockFingerId(FingerId);

            RaycastHit hit;

            if (GestureTouchesUtility.RaycastFromCamera(StartPosition, out hit))
            {
                var gameObject = hit.transform.gameObject;
                if (gameObject != null)
                {
                    TargetObject = gameObject.GetComponentInParent <Manipulator>().gameObject;
                }
            }

            Touch touch;

            GestureTouchesUtility.TryFindTouch(FingerId, out touch);
            Position = touch.position;
        }
 /// <summary>
 /// Action to be performed when this gesture is started.
 /// </summary>
 protected internal override void OnStart()
 {
     GestureTouchesUtility.LockFingerId(FingerId1);
     GestureTouchesUtility.LockFingerId(FingerId2);
 }