예제 #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);
            }
        }
예제 #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);
            }
        }
예제 #3
0
파일: Editor.cs 프로젝트: Aglay/FlaxAPI
        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);
            }
        }