ParticleEffect出现无法加载完成的异常

This commit is contained in:
2025-11-30 17:33:26 +08:00
parent 0b80d0a775
commit 430209c948
5 changed files with 66 additions and 45 deletions

View File

@@ -69,41 +69,38 @@ namespace Demo.Game
protected override void UpdateTicks(float currentTime, float deltaTime, TickType tickType)
{
using (Profiler.BeginZone($"Updatement<{typeof(DataType).Name}>.UpdateTicks"))
base.UpdateTicks(currentTime, deltaTime, tickType);
float GetPercentValue()
{
base.UpdateTicks(currentTime, deltaTime, tickType);
return (currentTime - Entries[Content].TimePoint) / (Entries[Content + 1].TimePoint - Entries[Content].TimePoint);
}
float GetPercentValue()
{
return (currentTime - Entries[Content].TimePoint) / (Entries[Content + 1].TimePoint - Entries[Content].TimePoint);
}
if (Entries.Count <= 1)
return;
switch (tickType)
{
case TickType.Reset:
case TickType.Start:
{
Content = 0;
while (Content + 1 < Entries.Count && Entries[Content + 1].TimePoint < currentTime)
Content++;
UpdateEntry(Content, GetPercentValue());
}
break;
default:
if (Entries[0].TimePoint > currentTime)
return;
if (Content + 1 >= Entries.Count)
return;
if (Entries[Content + 1].TimePoint < currentTime)
if (Entries.Count <= 1)
return;
switch (tickType)
{
case TickType.Reset:
case TickType.Start:
{
Content = 0;
while (Content + 1 < Entries.Count && Entries[Content + 1].TimePoint < currentTime)
Content++;
if (Content + 1 >= Entries.Count)
UpdateEntry(Content, 1);
else
UpdateEntry(Content, GetPercentValue());
break;
}
UpdateEntry(Content, GetPercentValue());
}
break;
default:
if (Entries[0].TimePoint > currentTime)
return;
if (Content + 1 >= Entries.Count)
return;
if (Entries[Content + 1].TimePoint < currentTime)
Content++;
if (Content + 1 >= Entries.Count)
UpdateEntry(Content, 1);
else
UpdateEntry(Content, GetPercentValue());
break;
}
}