use bevy::prelude::*;
#[derive(SystemSet, Debug, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord)]
pub enum TiledPreUpdateSystems {
First,
ProcessLoadedWorlds,
ProcessLoadedMaps,
InitializePhysicsSettings,
SpawnPhysicsColliders,
Last,
}
#[derive(SystemSet, Debug, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord)]
pub enum TiledUpdateSystems {
First,
AnimateSprite,
UpdateParallaxLayers,
UpdateTiledImagePositionAndSize,
Debug,
Last,
}
#[derive(SystemSet, Debug, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord)]
pub enum TiledPostUpdateSystems {
First,
HandlePhysicsSettingsUpdate,
HandleWorldAssetEvents,
HandleWorldChunking,
HandleMapAssetEvents,
Last,
}
pub(crate) fn plugin(app: &mut App) {
app.configure_sets(
PreUpdate,
(
TiledPreUpdateSystems::First,
TiledPreUpdateSystems::ProcessLoadedWorlds,
TiledPreUpdateSystems::ProcessLoadedMaps,
TiledPreUpdateSystems::InitializePhysicsSettings,
TiledPreUpdateSystems::SpawnPhysicsColliders,
TiledPreUpdateSystems::Last,
)
.chain(),
);
app.configure_sets(
Update,
(
TiledUpdateSystems::First,
TiledUpdateSystems::AnimateSprite,
TiledUpdateSystems::UpdateParallaxLayers,
TiledUpdateSystems::UpdateTiledImagePositionAndSize,
TiledUpdateSystems::Debug,
TiledUpdateSystems::Last,
)
.chain(),
);
app.configure_sets(
PostUpdate,
(
TiledPostUpdateSystems::First,
TiledPostUpdateSystems::HandlePhysicsSettingsUpdate,
TiledPostUpdateSystems::HandleWorldAssetEvents,
TiledPostUpdateSystems::HandleWorldChunking,
TiledPostUpdateSystems::HandleMapAssetEvents,
TiledPostUpdateSystems::Last,
)
.chain(),
);
}