Exemple #1
0
        internal void Update()
        {
            try
            {
                Profiler.BeginEvent("Editor.Update");

                StateMachine.Update();
                UpdateAutoSave();

                if (!StateMachine.IsPlayMode)
                {
                    SetupEditorFPS();
                }

                // Update modules
                for (int i = 0; i < _modules.Count; i++)
                {
                    _modules[i].OnUpdate();
                }

                if (Input.GetKeyDown(Keys.F6))
                {
                    Simulation.RequestResumeOrPause();
                }

                Profiler.EndEvent();
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
        }
Exemple #2
0
        internal void Update()
        {
            try
            {
                // Update state machine
                StateMachine.Update();

                // Drop performance if app has no focus (only when game is not running)
                if (!StateMachine.IsPlayMode)
                {
                    bool isFocused = Application.HasFocus;
                    Time.DrawFPS    = isFocused ? 60 : 15;
                    Time.UpdateFPS  = isFocused ? 60 : 15;
                    Time.PhysicsFPS = isFocused ? 30 : 20;
                }

                // Update modules
                for (int i = 0; i < _modules.Count; i++)
                {
                    _modules[i].OnUpdate();
                }

                if (Input.GetKeyDown(Keys.F6))
                {
                    Simulation.RequestResumeOrPause();
                }
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
        }
Exemple #3
0
        internal void Update()
        {
            try
            {
                Profiler.BeginEvent("Editor.Update");

                StateMachine.Update();
                UpdateAutoSave();

                // Drop performance if app has no focus (only when game is not running)
                if (!StateMachine.IsPlayMode)
                {
                    bool isFocused = Platform.HasFocus;
                    Time.DrawFPS    = isFocused ? 60 : 15;
                    Time.UpdateFPS  = isFocused ? 60 : 15;
                    Time.PhysicsFPS = isFocused ? 30 : 20;
                }

                // Update modules
                for (int i = 0; i < _modules.Count; i++)
                {
                    _modules[i].OnUpdate();
                }

                if (Input.GetKeyDown(Keys.F6))
                {
                    Simulation.RequestResumeOrPause();
                }

                Profiler.EndEvent();
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
        }