Ejemplo n.º 1
0
        // This will return the recorded position of the current finger when it was at 'targetAge'
        public Vector2 GetSnapshotScreenPosition(float targetAge)
        {
            var screenPosition = ScreenPosition;

            LeanSnapshot.TryGetScreenPosition(Snapshots, targetAge, ref screenPosition);

            return(screenPosition);
        }
Ejemplo n.º 2
0
        protected virtual void Update()
        {
            // Is the recording being played back?
            if (Playing == true)
            {
                PlayTime += Time.deltaTime;

                var screenPosition = default(Vector2);

                if (LeanSnapshot.TryGetScreenPosition(snapshots, PlayTime, ref screenPosition) == true)
                {
                    Cursor.position = ScreenDepth.Convert(screenPosition, Camera, gameObject);
                }
            }
        }
Ejemplo n.º 3
0
        protected virtual void Update()
        {
            // Is the recording being played back?
            if (Playing == true)
            {
                PlayTime += Time.deltaTime;

                var screenPosition = default(Vector2);

                if (LeanSnapshot.TryGetScreenPosition(snapshots, PlayTime, ref screenPosition) == true)
                {
                    // Make sure the camera exists
                    var camera = LeanTouch.GetCamera(Camera, gameObject);

                    if (camera != null)
                    {
                        Cursor.position = camera.ScreenToWorldPoint(new Vector3(screenPosition.x, screenPosition.y, Distance));
                    }
                }
            }
        }