We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c733411 commit 2f8f27fCopy full SHA for 2f8f27f
src/engine.ts
@@ -10,9 +10,18 @@ export class AnimationEngine {
10
11
addSystem(system: System) {
12
this.systems.push(system);
13
- }
+ }
14
15
- update() {
+ private prepare() {
16
+ // Prepare all systems
17
+ this.systems.forEach((system) => {
18
+ if(system.prepare) {
19
+ system.prepare(this.entities);
20
21
+ });
22
23
+
24
+ private update() {
25
// let anyActive = false;
26
27
// Update all systems, but only for active entities
@@ -61,6 +70,7 @@ export class AnimationEngine {
61
70
62
71
// Start the loop on initialization
63
72
start() {
73
+ this.prepare();
64
74
this.loop();
65
75
}
66
76
0 commit comments