File tree 1 file changed +8
-2
lines changed 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -189,11 +189,17 @@ fn construction_timer_finished(timer: Res<ConstructionTimer>) -> bool {
189
189
timer . finished ()
190
190
}
191
191
192
+ // Timers need to be ticked!
193
+ fn tick_construction_timer (timer : ResMut <ConstructionTimer >, time : Res <Time >){
194
+ timer . tick (time . delta ());
195
+ }
196
+
192
197
fn main (){
193
198
App :: new ()
194
199
. add_plugins (DefaultPlugins )
195
- // We can add functions as run criteria
196
- . add_system (update_construction_progress . run_if (construction_timer_finished ))
200
+ // We can add functions with read-only system parameters as run criteria
201
+ . add_system_chain ([tick_construction_timer ,
202
+ update_construction_progress . run_if (construction_timer_finished )])
197
203
// We can use closures for simple one-off run criteria,
198
204
// which automatically fetch the appropriate data from the `World`
199
205
. add_system (spawn_more_enemies . run_if (| difficulty : Res <Difficulty >| difficulty >= 9000 ))
You can’t perform that action at this time.
0 commit comments