Skip to content

Commit

Permalink
Delay init after scene has finished loading
Browse files Browse the repository at this point in the history
  • Loading branch information
acidbubbles committed Mar 5, 2024
1 parent d615b17 commit 7337b1c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Scripter.Plugin/src/Scripter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
Expand Down

0 comments on commit 7337b1c

Please sign in to comment.