1.修复多处错误2.SplineNode依然存在设置不生效的错误

This commit is contained in:
2025-10-05 20:18:48 +08:00
parent c108b2b844
commit 8f8dfcbb64
89 changed files with 104 additions and 1310 deletions

View File

@@ -65,6 +65,12 @@ namespace Demo.Game
protected override void UpdateTicks(float currentTime, float deltaTime, TickType tickType)
{
base.UpdateTicks(currentTime, deltaTime, tickType);
float GetPercentValue()
{
return (currentTime - Entries[Content].TimePoint) / (Entries[Content + 1].TimePoint - Entries[Content].TimePoint);
}
if (Entries.Count == 0)
return;
if (Entries.Count == 1)
@@ -72,22 +78,20 @@ namespace Demo.Game
UpdateEntry(0, 0);
return;
}
// TODO : 删除后存在问题
if (Entries[0].TimePoint <= 0 && tickType == TickType.Reset)
{
UpdateEntry(0, 0);
}
switch (tickType)
{
case TickType.Pause:
//case TickType.LateUpdate:
break;
case TickType.Reset:
case TickType.Start:
{
Content = 0;
while (Content + 1 < Entries.Count && Entries[Content + 1].TimePoint < currentTime)
Content++;
UpdateEntry(Content, 0);
UpdateEntry(Content, GetPercentValue());
}
break;
default:
@@ -100,7 +104,7 @@ namespace Demo.Game
if (Content + 1 >= Entries.Count)
UpdateEntry(Content, 1);
else
UpdateEntry(Content, (currentTime - Entries[Content].TimePoint) / (Entries[Content + 1].TimePoint - Entries[Content].TimePoint));
UpdateEntry(Content, GetPercentValue());
break;
}
}