Beispiel #1
0
        //-----------------------------------------------------------------------------------
        public UN_SimulationProperties SimulatingBeginFirst(SimulationParams simParams)
        {
            SceneView.RepaintAll();

            fps_       = (int)simParams.fps_;
            frameTime_ = 1.0 / simParams.fps_;

            BufferAnimations(simParams.totalTime_, simParams.fps_);

            SimulationManager.ResetTimeSlider();
            SimulationManager.EditingEnd();

            SimulationManager.SetBroadcastMode(UN_BROADCAST_MODE.SIMULATING);
            SimulationManager.SimulatingBeginFirst(simParams);

            UN_SimulationProperties un_simProperties = new UN_SimulationProperties();;

            SimulationManager.GetSimulationProperties(un_simProperties);

            entityManager_.DisableEditingObjects();

            lastSimulatingTime_ = EditorApplication.timeSinceStartup;

            frameSpentTime_      = 0f;
            frameTimeEstimation_ = float.MaxValue;

            iterationTimeEstimation_ = frameTimeEstimation_ / nIterations_;

            EditorApplication.update -= UpdateSimulating;
            EditorApplication.update += UpdateSimulating;

            SimulationManager.PauseOff();

            return(un_simProperties);
        }