Updates the Time settings for Update/FixedUpdate/Draw frequency. Can be overriden per-state.
()
| 92 | /// Updates the Time settings for Update/FixedUpdate/Draw frequency. Can be overriden per-state. |
| 93 | /// </summary> |
| 94 | public virtual void UpdateFPS() |
| 95 | { |
| 96 | var generalOptions = Editor.Options.Options.General; |
| 97 | var editorFps = generalOptions.EditorFPS; |
| 98 | if (!Platform.HasFocus) |
| 99 | { |
| 100 | // Drop performance if app has no focus |
| 101 | Time.DrawFPS = generalOptions.EditorFPSWhenNotFocused; |
| 102 | Time.UpdateFPS = generalOptions.EditorFPSWhenNotFocused; |
| 103 | } |
| 104 | else if (editorFps < 1) |
| 105 | { |
| 106 | // Unlimited power!!! |
| 107 | Time.DrawFPS = 0; |
| 108 | Time.UpdateFPS = 0; |
| 109 | } |
| 110 | else |
| 111 | { |
| 112 | // Custom or default value but just don't go too low |
| 113 | editorFps = Mathf.Max(editorFps, 10); |
| 114 | Time.DrawFPS = editorFps; |
| 115 | Time.UpdateFPS = editorFps; |
| 116 | } |
| 117 | |
| 118 | // Physics is not so much used in edit time |
| 119 | Time.PhysicsFPS = 30; |
| 120 | } |
| 121 | |
| 122 | /// <inheritdoc /> |
| 123 | public override bool CanExit(State nextState) |