|
|
@ -16,17 +16,11 @@ stageManager.watchStageChange((stage, lastStage) => { |
|
|
|
} |
|
|
|
}); |
|
|
|
gameManager.ticker.add((dt: number) => { |
|
|
|
if(stageManager.curStage){ |
|
|
|
let curWindow = windows[stageManager.curStage.name]; |
|
|
|
residentList.forEach(v=>v.update&&v.update(dt)) |
|
|
|
curWindow.update && curWindow.update(dt); |
|
|
|
gameManager.render(); |
|
|
|
curWindow.lateUpdate && curWindow.lateUpdate(dt); |
|
|
|
residentList.forEach(v=>v.lateUpdate&&v.lateUpdate(dt)) |
|
|
|
}else{ |
|
|
|
residentList.forEach(v=>v.update&&v.update(dt)) |
|
|
|
gameManager.render(); |
|
|
|
residentList.forEach(v=>v.lateUpdate&&v.lateUpdate(dt)) |
|
|
|
} |
|
|
|
let curWindow = windows[stageManager.curStage.name]; |
|
|
|
residentList.forEach(v=>v.update&&v.update(dt, v.stage.name)) |
|
|
|
stageManager.curStage && curWindow && curWindow.update && curWindow.update(dt, curWindow.stage.name); |
|
|
|
gameManager.render(); |
|
|
|
stageManager.curStage && curWindow && curWindow.lateUpdate && curWindow.lateUpdate(dt, curWindow.stage.name); |
|
|
|
residentList.forEach(v=>v.lateUpdate&&v.lateUpdate(dt, v.stage.name)) |
|
|
|
}); |
|
|
|
stageManager.initStage("welcome"); |
|
|
|