优化加载Apply

This commit is contained in:
2025-12-02 16:39:29 +08:00
parent 00729395a3
commit 11623b044b
2 changed files with 24 additions and 16 deletions

View File

@@ -221,17 +221,17 @@ namespace Demo.Game
rootGameObject.SetContent(nameof(IsAutoPlay), IsAutoPlay ? 1 : 0);
rootGameObject.SetContent("SongLength", MainAudio.CurrentClip.length);
yield return rootGameObject.ParseScript2Expr(rootObject.LoadAsText());
yield return rootGameObject.ApplyScript();
IEnumerator NDFS(ScriptableObject current)
static void NDFS(ScriptableObject current)
{
foreach (var child in current.Childs)
{
yield return NDFS(child);
NDFS(child);
}
if (current.IsScriptApply == false)
yield return current.ApplyScript();
ConventionUtility.StartCoroutine(current.ApplyScript());
}
yield return NDFS(rootGameObject);
//yield return
NDFS(rootGameObject);
}
}
finally