From 7337b1c534156e4ac064523e68f710eabad5fb09 Mon Sep 17 00:00:00 2001 From: Acid Bubbles Date: Mon, 4 Mar 2024 20:48:05 -0500 Subject: [PATCH] Delay init after scene has finished loading --- Scripter.Plugin/src/Scripter.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Scripter.Plugin/src/Scripter.cs b/Scripter.Plugin/src/Scripter.cs index 58c0fd7..99449ca 100644 --- a/Scripter.Plugin/src/Scripter.cs +++ b/Scripter.Plugin/src/Scripter.cs @@ -69,6 +69,19 @@ private IEnumerator DeferredInit() yield return new WaitForEndOfFrame(); if (this == null) yield break; + while (SuperController.singleton.isLoading) + { + yield return 0; + if (this == null) yield break; + } + + var confirmPanel = SuperController.singleton.errorLogPanel.parent.Find("UserConfirmCanvas"); + while (confirmPanel != null && confirmPanel.childCount > 0) + { + yield return 0; + if (this == null) yield break; + } + if (IsSessionPlugin()) { _syncFolder = $"Saves\\PluginData\\Scripter\\Session\\{name}";