推进中, 解析存在错误
This commit is contained in:
@@ -194,19 +194,26 @@ namespace Demo.Game
|
||||
var rootObject = new ToolFile(Path.Combine(content.RootSourceDir, rootFileName));
|
||||
rootObject.MustExistsPath();
|
||||
var rootGameObject = new GameObject(rootObject.GetName(true)).AddComponent<RootObject>();
|
||||
MainObject = rootGameObject;
|
||||
rootGameObject.transform.SetParent(transform);
|
||||
rootGameObject.ScriptName = rootObject.GetName(true);
|
||||
rootGameObject.audioSystem = MainAudio;
|
||||
rootGameObject.EnableScript(content.RootSourceDir, this);
|
||||
try
|
||||
rootGameObject.SetContent(nameof(SongOffset), SongOffset);
|
||||
rootGameObject.SetContent(nameof(IsAutoPlay), IsAutoPlay ? 1 : 0);
|
||||
rootGameObject.SetContent("SongLength", MainAudio.CurrentClip.length);
|
||||
yield return rootGameObject.ParseScript2Expr(rootObject.LoadAsText());
|
||||
yield return rootGameObject.ApplyScript();
|
||||
IEnumerator DFS(ScriptableObject parent)
|
||||
{
|
||||
yield return rootGameObject.ParseScript2Expr(rootObject.LoadAsText());
|
||||
yield return rootGameObject.ApplyScript();
|
||||
}
|
||||
finally
|
||||
{
|
||||
MainObject = rootGameObject;
|
||||
foreach (var child in parent.Childs)
|
||||
{
|
||||
if (child.IsScriptApply == false)
|
||||
yield return child.ApplyScript();
|
||||
yield return DFS(child);
|
||||
}
|
||||
}
|
||||
yield return DFS(rootGameObject);
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user