File tree 1 file changed +5
-15
lines changed
1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -204,21 +204,11 @@ fn update_loading_data(
204
204
// we reset the confirmation frame count.
205
205
loading_data. confirmation_frames_count = 0 ;
206
206
207
- // Go through each asset and verify their load states.
208
- // Any assets that are loaded are then added to the pop list for later removal.
209
- let mut pop_list: Vec < usize > = Vec :: new ( ) ;
210
- for ( index, asset) in loading_data. loading_assets . iter ( ) . enumerate ( ) {
211
- if let Some ( state) = asset_server. get_load_states ( asset) {
212
- if state. 2 . is_loaded ( ) {
213
- pop_list. push ( index) ;
214
- }
215
- }
216
- }
217
-
218
- // Remove all loaded assets from the loading_assets list.
219
- for i in pop_list. iter ( ) {
220
- loading_data. loading_assets . remove ( * i) ;
221
- }
207
+ loading_data. loading_assets . retain ( |asset| {
208
+ asset_server
209
+ . get_recursive_dependency_load_state ( asset)
210
+ . is_none_or ( |state| !state. is_loaded ( ) )
211
+ } ) ;
222
212
223
213
// If there are no more assets being monitored, and pipelines
224
214
// are compiled, then start counting confirmation frames.
You can’t perform that action at this time.
0 commit comments