frameStart method
Starts a frame and returns its scaled delta.
Implementation
double frameStart(Duration elapsed, double deltaSeconds) {
// Advance the profiler frame counter (if profiling is enabled) at the one
// per-frame boundary, so timings can be attributed to a frame number.
app.profiler?.beginFrame();
final clock = app.world.resources.get<GameClock>();
// Apply a partial freeze to its full frame.
final scaledDelta = deltaSeconds * clock.effectiveScale;
clock.advanceFreeze(deltaSeconds);
app.world.resources.get<FrameTime>()
..delta = scaledDelta
..unscaledDelta = deltaSeconds
..elapsed = elapsed
..frame += 1;
// Age inputs before frame start.
advanceInputBuffers(app.world.resources.values, deltaSeconds);
app.runSchedule(Schedules.frameStart);
app.applyStateTransitions();
onCommandBoundary?.call();
app.updateEvents();
return scaledDelta;
}