From df6dc6b21fc8224cac094ff17f9143848eb556a0 Mon Sep 17 00:00:00 2001 From: Nejcraft Date: Wed, 31 Mar 2021 16:51:11 +0200 Subject: [PATCH 1/4] Bump up default Update FPS This cant possibly do any harm as if it is too much it will get skipped and work like it is on these FPSs while remaining to work consistantly, while if it is possible to get to the 60 fps, things like scripted camera, ChracterController etc. will move more better. --- Source/Engine/Engine/Time.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Engine/Engine/Time.cpp b/Source/Engine/Engine/Time.cpp index f26f4f759..2dd348207 100644 --- a/Source/Engine/Engine/Time.cpp +++ b/Source/Engine/Engine/Time.cpp @@ -17,7 +17,7 @@ namespace bool Time::_gamePaused = false; float Time::_physicsMaxDeltaTime = 0.1f; DateTime Time::StartupTime; -float Time::UpdateFPS = 30.0f; +float Time::UpdateFPS = 60.0f; float Time::PhysicsFPS = 60.0f; float Time::DrawFPS = 60.0f; float Time::TimeScale = 1.0f; From 3a5c3cabba1f3566036cb1babca5e7e2493f1aec Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 2 Apr 2021 16:51:12 +0200 Subject: [PATCH 2/4] Add missing doc comment --- Source/Editor/Content/Items/VisualScriptItem.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Editor/Content/Items/VisualScriptItem.cs b/Source/Editor/Content/Items/VisualScriptItem.cs index 22f1d75cc..e2a390b60 100644 --- a/Source/Editor/Content/Items/VisualScriptItem.cs +++ b/Source/Editor/Content/Items/VisualScriptItem.cs @@ -75,6 +75,7 @@ namespace FlaxEditor.Content } } + /// public int MetadataToken => 0; /// From 2d6f8cc406662b2d5c7727d1467f2583346eaaca Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 6 Apr 2021 10:42:11 +0200 Subject: [PATCH 3/4] Change default Update FPS in time settings to 60 #414 --- Source/Engine/Core/Config/TimeSettings.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Engine/Core/Config/TimeSettings.h b/Source/Engine/Core/Config/TimeSettings.h index 7e383380f..bdfcd927a 100644 --- a/Source/Engine/Core/Config/TimeSettings.h +++ b/Source/Engine/Core/Config/TimeSettings.h @@ -15,31 +15,31 @@ public: /// /// The target amount of the game logic updates per second (script updates frequency). /// - API_FIELD(Attributes="EditorOrder(1), DefaultValue(30.0f), Limit(0, 1000), EditorDisplay(\"General\", \"Update FPS\")") - float UpdateFPS = 30.0f; + API_FIELD(Attributes="EditorOrder(1), Limit(0, 1000), EditorDisplay(\"General\", \"Update FPS\")") + float UpdateFPS = 60.0f; /// /// The target amount of the physics simulation updates per second (also fixed updates frequency). /// - API_FIELD(Attributes="EditorOrder(2), DefaultValue(60.0f), Limit(0, 1000), EditorDisplay(\"General\", \"Physics FPS\")") + API_FIELD(Attributes="EditorOrder(2), Limit(0, 1000), EditorDisplay(\"General\", \"Physics FPS\")") float PhysicsFPS = 60.0f; /// /// The target amount of the frames rendered per second (actual game FPS). /// - API_FIELD(Attributes="EditorOrder(3), DefaultValue(60.0f), Limit(0, 1000), EditorDisplay(\"General\", \"Draw FPS\")") + API_FIELD(Attributes="EditorOrder(3), Limit(0, 1000), EditorDisplay(\"General\", \"Draw FPS\")") float DrawFPS = 60.0f; /// /// The game time scale factor. Default is 1. /// - API_FIELD(Attributes="EditorOrder(10), DefaultValue(1.0f), Limit(0, 1000.0f, 0.1f), EditorDisplay(\"General\")") + API_FIELD(Attributes="EditorOrder(10), Limit(0, 1000.0f, 0.1f), EditorDisplay(\"General\")") float TimeScale = 1.0f; /// /// The maximum allowed delta time (in seconds) for the game logic update step. /// - API_FIELD(Attributes="EditorOrder(20), DefaultValue(0.1f), Limit(0.1f, 1000.0f, 0.01f), EditorDisplay(\"General\")") + API_FIELD(Attributes="EditorOrder(20), Limit(0.1f, 1000.0f, 0.01f), EditorDisplay(\"General\")") float MaxUpdateDeltaTime = 0.1f; public: From c8c215abfd10bcca29d585b0370dd485136a56d1 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 6 Apr 2021 15:47:00 +0200 Subject: [PATCH 4/4] Add support for custom value propagation in CustomEditor --- Source/Editor/CustomEditors/CustomEditor.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/Editor/CustomEditors/CustomEditor.cs b/Source/Editor/CustomEditors/CustomEditor.cs index c5c628755..ca45652b9 100644 --- a/Source/Editor/CustomEditors/CustomEditor.cs +++ b/Source/Editor/CustomEditors/CustomEditor.cs @@ -250,6 +250,15 @@ namespace FlaxEditor.CustomEditors _children[i].RefreshInternal(); } + /// + /// Synchronizes the value of the container. Called during Refresh to flush property after editing it in UI. + /// + /// The value to set. + protected virtual void SynchronizeValue(object value) + { + _values.Set(_parent.Values, value); + } + internal virtual void RefreshInternal() { if (_values == null) @@ -264,7 +273,7 @@ namespace FlaxEditor.CustomEditors _valueToSet = null; // Assign value - _values.Set(_parent.Values, val); + SynchronizeValue(val); // Propagate values up (eg. when member of structure gets modified, also structure should be updated as a part of the other object) var obj = _parent;