阶段2/IUpdateable接口适配

This commit is contained in:
2025-12-01 17:54:03 +08:00
parent 07fa883537
commit f37658a481
4 changed files with 131 additions and 10 deletions

View File

@@ -8,9 +8,9 @@ namespace Demo.Game
public interface IUpdateable
{
/// <summary>
/// 直接Update调用无递归
/// 扁平化优化Update调用直接更新对象自身(无递归遍历子对象)
/// </summary>
void DoUpdate(float currentTime, float deltaTime, ScriptableObject.TickType tickType);
void FlatOptimizationUpdate(float currentTime, float deltaTime, ScriptableObject.TickType tickType);
/// <summary>
/// 对象名称,用于调试

View File

@@ -113,7 +113,7 @@ namespace Demo.Game
{
if (permanentObjects[i]?.IsUpdateReady == true)
{
permanentObjects[i].DoUpdate(currentTime, deltaTime, tickType);
permanentObjects[i].FlatOptimizationUpdate(currentTime, deltaTime, tickType);
}
}
@@ -126,7 +126,7 @@ namespace Demo.Game
continue;
}
activeObjects[i].DoUpdate(currentTime, deltaTime, tickType);
activeObjects[i].FlatOptimizationUpdate(currentTime, deltaTime, tickType);
}
}
}