graph管线必须开启兼容模式

This commit is contained in:
2025-12-18 17:57:10 +08:00
parent ab60b35be2
commit 209df04d82
5 changed files with 64 additions and 67 deletions

View File

@@ -52,8 +52,11 @@ namespace Demo.Game
[Header("Environment")]
[Resources] public Transform GlobalLight;
private bool IsGameLoading = false;
public IEnumerator GameInit()
{
IsGameLoading = true;
float gameInitStartTime = Time.realtimeSinceStartup;
try
{
@@ -230,27 +233,7 @@ namespace Demo.Game
rootGameObject.SetContent("SongLength", MainAudio.CurrentClip.length);
if (isRecompile || true)
{
static IEnumerator Foo(IEnumerator ir)
{
Stack<IEnumerator> loadingTask = new();
loadingTask.Push(ir);
while (loadingTask.Count > 0)
{
if (loadingTask.Peek().MoveNext())
{
if (loadingTask.Peek().Current is IEnumerator next)
loadingTask.Push(next);
else if (loadingTask.Peek().Current is ScriptableObject)
yield return null;
}
else
{
loadingTask.Pop();
}
}
yield break;
}
yield return ConventionUtility.AvoidFakeStop(rootGameObject.ParseFromScriptFile2Expr(rootObject));//Foo(rootGameObject.ParseFromScriptFile2Expr(rootObject));
yield return ConventionUtility.AvoidFakeStop(rootGameObject.ParseFromScriptFile2Expr(rootObject));
int applyDownCount = 0;
void NDFS(ScriptableObject current)
{
@@ -324,6 +307,7 @@ namespace Demo.Game
MainConfig.SaveProperties();
float gameInitEndTime = Time.realtimeSinceStartup;
float gameInitElapsed = (gameInitEndTime - gameInitStartTime) * 1000f;
IsGameLoading = false;
Debug.Log($"[GameInit] 总耗时: {gameInitElapsed:F2} ms", this);
}
}
@@ -340,7 +324,8 @@ namespace Demo.Game
{
yield return null;
IsEnableUpdate = true;
yield return new WaitUntil(() => MainObject != null);
yield return new WaitUntil(() => MainObject != null && IsGameLoading == false);
yield return null;
MainObject.ScriptUpdate(SongOffset, Time.deltaTime, ScriptableObject.TickType.Reset);
}

View File

@@ -194,20 +194,20 @@ namespace Demo
public RScriptVariables GenerateVariables(ScriptableObject self)
{
RScriptVariables variables = new()
{
{ "this", new() { data = self, type = self.GetType() } },
{ "self", new() { data = self, type = self.GetType() } },
{ "console", new() { data = new ConsoleTool(gameObject), type = typeof(ConsoleTool) } },
{ nameof(MathExtension.EaseCurveType), new() { data = EaseCurveTypeInstance.instance, type = typeof(EaseCurveTypeInstance) } },
{ $"Spline{nameof(SplineComputer.SampleMode)}",
new() { data = SplineComputerSampleModeInstance.instance, type = typeof(SplineComputerSampleModeInstance)} },
{ $"Spline{nameof(Spline.Type)}",
new() { data = SplineTypeInstance.instance, type = typeof(SplineTypeInstance)} },
{ nameof(IEffectHookObject.InteractiveEffectType),
new() { data = IEffectHookObjectInstance.instance, type = typeof(IEffectHookObjectInstance)} },
{ nameof(IInteraction.JudgementLevel),
new() { data = IInteractionJudgementLevelInstance.instance, type = typeof(IInteractionJudgementLevelInstance) } }
};
{
{ "this", new() { data = self, type = self.GetType() } },
{ "self", new() { data = self, type = self.GetType() } },
{ "console", new() { data = new ConsoleTool(gameObject), type = typeof(ConsoleTool) } },
{ nameof(MathExtension.EaseCurveType), new() { data = EaseCurveTypeInstance.instance, type = typeof(EaseCurveTypeInstance) } },
{ $"Spline{nameof(SplineComputer.SampleMode)}",
new() { data = SplineComputerSampleModeInstance.instance, type = typeof(SplineComputerSampleModeInstance)} },
{ $"Spline{nameof(Spline.Type)}",
new() { data = SplineTypeInstance.instance, type = typeof(SplineTypeInstance)} },
{ nameof(IEffectHookObject.InteractiveEffectType),
new() { data = IEffectHookObjectInstance.instance, type = typeof(IEffectHookObjectInstance)} },
{ nameof(IInteraction.JudgementLevel),
new() { data = IInteractionJudgementLevelInstance.instance, type = typeof(IInteractionJudgementLevelInstance) } }
};
return variables;
}