Move AssetEvents to Last (#12389)

# Objective

- Fixes https://github.com/bevyengine/bevy/issues/12380

## Solution

- Before #11986 AssetEvents were scheduled after PostUpdate. That pr
moved these into First. This PR moves them into Last which is closer to
how they were scheduled before.
This commit is contained in:
Mike 2024-03-09 13:15:02 -08:00 committed by GitHub
parent 8e467f4cad
commit 8a08825348
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,7 +49,7 @@ use crate::{
io::{embedded::EmbeddedAssetRegistry, AssetSourceBuilder, AssetSourceBuilders, AssetSourceId},
processor::{AssetProcessor, Process},
};
use bevy_app::{App, First, Plugin, PreUpdate};
use bevy_app::{App, Last, Plugin, PreUpdate};
use bevy_ecs::{
reflect::AppTypeRegistry,
schedule::{IntoSystemConfigs, IntoSystemSetConfigs, SystemSet},
@ -380,9 +380,8 @@ impl AssetApp for App {
.add_event::<AssetLoadFailedEvent<A>>()
.register_type::<Handle<A>>()
.add_systems(
First,
Last,
Assets::<A>::asset_events
.before(bevy_ecs::event::event_update_system::<AssetEvent<A>>)
.run_if(Assets::<A>::asset_events_condition)
.in_set(AssetEvents),
)