From 6fa1db6355b730a7164516b690ef571464fddb68 Mon Sep 17 00:00:00 2001 From: user01 Date: Fri, 26 Dec 2025 09:11:00 +0100 Subject: [PATCH 1/2] fix [ExecuteAlways]: scheduler lazy init moved to `OnEnable` - `Awake` is *not* called consistently enough for others [ExecuteAlways]/[ExecuteInEditMode] Updates.., Having scheduler in OnEnable seems to be enough for now, but needs whole lazy init currently in Awake to be updated/moved... --- Runtime/Scripts/IO/UGUI/ImuiUnityGUIBackend.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Runtime/Scripts/IO/UGUI/ImuiUnityGUIBackend.cs b/Runtime/Scripts/IO/UGUI/ImuiUnityGUIBackend.cs index 88136ad..df77f27 100644 --- a/Runtime/Scripts/IO/UGUI/ImuiUnityGUIBackend.cs +++ b/Runtime/Scripts/IO/UGUI/ImuiUnityGUIBackend.cs @@ -97,7 +97,6 @@ protected override void Awake() } } - scheduler ??= GraphicsSettings.currentRenderPipeline ? new ImuiScriptableRenderingScheduler() : new ImuiBuiltinRenderingScheduler(); useGUILayout = false; } @@ -122,6 +121,8 @@ protected override void OnEnable() { base.OnEnable(); + scheduler ??= GraphicsSettings.currentRenderPipeline ? new ImuiScriptableRenderingScheduler() : new ImuiBuiltinRenderingScheduler(); + if (ClearTexture == null) { ClearTexture = new Texture2D(1, 1, TextureFormat.RGBA32, false); From e72d02c4d5e6fa79a90e1c67bc36eb032d5bb0ba Mon Sep 17 00:00:00 2001 From: user01 Date: Sat, 27 Dec 2025 09:20:46 +0100 Subject: [PATCH 2/2] [Window] make rect `ref` to make window size/position known useful for saving/restoring window state after e.g. modified by dragging/resizing --- Runtime/Scripts/Controls/ImWindow.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Runtime/Scripts/Controls/ImWindow.cs b/Runtime/Scripts/Controls/ImWindow.cs index aaf2cc6..740720f 100644 --- a/Runtime/Scripts/Controls/ImWindow.cs +++ b/Runtime/Scripts/Controls/ImWindow.cs @@ -29,16 +29,16 @@ public static bool BeginWindow(this ImGui gui, string title, ref bool open, ImSi { var rect = GetInitialWindowRect(gui, size); - return BeginWindow(gui, title, ref open, rect, flags); + return BeginWindow(gui, title, ref open, ref rect, flags); } - public static void BeginWindow(this ImGui gui, string title, ImRect rect, ImWindowFlag flags = ImWindowFlag.None) + public static void BeginWindow(this ImGui gui, string title, ref ImRect rect, ImWindowFlag flags = ImWindowFlag.None) { var open = true; - BeginWindow(gui, title, ref open, rect, flags | ImWindowFlag.NoCloseButton); + BeginWindow(gui, title, ref open, ref rect, flags | ImWindowFlag.NoCloseButton); } - public static bool BeginWindow(this ImGui gui, string title, ref bool open, ImRect rect, ImWindowFlag flags = ImWindowFlag.None) + public static bool BeginWindow(this ImGui gui, string title, ref bool open, ref ImRect rect, ImWindowFlag flags = ImWindowFlag.None) { if (!open) { @@ -81,6 +81,8 @@ public static bool BeginWindow(this ImGui gui, string title, ref bool open, ImRe gui.Layout.Push(ImAxis.Vertical, contentRect); gui.BeginScrollable(); + rect = state.Rect; + return true; }