Exemplo n.º 1
0
        private void Update()
        {
            Status.text = "Device Model: " + SystemInfo.deviceModel + Environment.NewLine +
                          "CenterMode: " + Session.CenterMode + Environment.NewLine +
                          Environment.NewLine +
                          "Gesture Instruction" + Environment.NewLine +
                          "\tMove on Surface: One Finger Move" + Environment.NewLine +
                          "\tRotate: Two Finger Horizontal Move" + Environment.NewLine +
                          "\tScale: Two Finger Pinch";

            if (Input.touchCount == 1 && !EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId))
            {
                var touch = Input.touches[0];
                if (touch.phase == TouchPhase.Moved)
                {
                    var viewPoint = new Vector2(touch.position.x / Screen.width, touch.position.y / Screen.height);
                    var coord     = Session.ImageCoordinatesFromScreenCoordinates(viewPoint);
                    if (tracker && tracker.Tracker != null && coord.OnSome)
                    {
                        tracker.Tracker.alignTargetToCameraImagePoint(coord.Value.ToEasyARVector());
                    }
                }
            }
        }