public void SetToTime(float time)
 {
     if (knots.m_size > 1)
     {
         CameraPath.scrubTime = Time.time;
         if (!CameraDirector.cameraController.enabled)
         {
             CameraPath.MoveCamera(time, 1f, CameraDirector.camera, knots, out time);
             return;
         }
         base.StartCoroutine(CameraPath.MoveCameraAsync(time, 1f, CameraDirector.camera, knots));
     }
 }
        public static System.Collections.IEnumerator MoveCameraAsync(float time, float speed, Camera camera, FastList <object> knots)
        {
            CameraDirector.cameraController.enabled = false;
            yield return(new WaitForSeconds(0.01f));

            float num;

            CameraPath.MoveCamera(time, speed, camera, knots, out num);
            do
            {
                yield return(new WaitForSeconds(0.05f));
            }while (Time.time - CameraPath.scrubTime < 0.03f || Input.GetMouseButton(0));
            CameraDirector.cameraController.enabled = true;
            CameraPath.SetCitiesCameraTransform(currentTransfrom);
            yield break;
        }
        public void Update()
        {
            if (playBack)
            {
                if (CameraDirector.useFps)
                {
                    if (stepcount == 0)
                    {
                        startTime = Stopwatch.GetTimestamp();
                    }

                    if (!CameraPath.MoveCamera(time, CameraDirector.mainWindow.playSpeed, CameraDirector.camera, knots, out time))
                    {
                        Stop();
                        return;
                    }
                    else
                    {
                        simulationStep.Invoke(SimulationManager.instance, null);
                        CameraDirector.camera.nearClipPlane = 1;
                    }

                    long expectedStart = startTime + (int)(waitTimeTarget * frequency * stepcount++);
                    int  wait          = (int)(waitTimeTarget - ((Stopwatch.GetTimestamp() - expectedStart) / frequency)) - 1;

                    if (wait > 0)
                    {
                        Thread.Sleep(wait);
                    }
                    while (playBack && (Stopwatch.GetTimestamp() - expectedStart) / frequency < waitTimeTarget)
                    {
                        ;
                    }
                }
                else
                {
                    if (!CameraPath.MoveCamera(time, CameraDirector.mainWindow.playSpeed, CameraDirector.camera, knots, out time))
                    {
                        Stop();
                    }
                }
            }
        }