清理各个 Component 里的判断以及调用规范

This commit is contained in:
2026-09-14 18:35:02 +08:00
parent 5fbeec2476
commit 17ee268416
30 changed files with 769 additions and 1326 deletions
@@ -49,7 +49,7 @@ namespace SepCore.Procedure
_levelTimerHandle = GameEntry.Timer.ScheduleOnce(levelConfig.Duration, OnLevelTimeUp, this);
_enemyManager.OnInit(levelConfig, Player);
if (Player != null) Player.Enable = true;
Player.Enable = true;
if (Application.isMobilePlatform)
{
@@ -61,12 +61,8 @@ namespace SepCore.Procedure
{
_enemyManager.OnUpdate(elapseSeconds, realElapseSeconds);
SimulationWorld simulationWorld = GameEntry.SimulationWorld;
if (simulationWorld != null)
{
Vector3 playerPosition = Player != null ? Player.CachedTransform.position : Vector3.zero;
simulationWorld.Tick(new SimulationTickContext(elapseSeconds, realElapseSeconds, playerPosition));
}
Vector3 playerPosition = Player.CachedTransform.position;
GameEntry.SimulationWorld.Tick(new SimulationTickContext(elapseSeconds, realElapseSeconds, playerPosition));
int timeLeft = Mathf.Max(0, (int)GameEntry.Timer.GetRemainingTime(_levelTimerHandle));
GameEntry.Event.Fire(this, LevelProcessEventArgs.Create(timeLeft));