// 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); }
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); } } }
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)); } } } }