清理各个 Component 里的判断以及调用规范
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user