NiklasEi / bevy_asset_loader

Bevy plugin helping with asset loading and organization
Apache License 2.0
459 stars 52 forks source link

State warning when switching to iyes_loopless #80

Closed Trenrod closed 1 year ago

Trenrod commented 1 year ago

After everything works fine Im trying to switch to iyes_loopless and followed the example iyes_loopless. As soon as I add line i get the error message below. Which i simply dont understand :(

 App::new()
        // prevents blurry sprites
        .insert_resource(ImageSettings::default_nearest())
        // Bevy defaults
        .add_plugins(DefaultPlugins)
        // Add camera
        .add_startup_system(system_startup)
        // Initial GameState state
        .add_loopless_state(GameStates::LoadingAssets)
        // Add loading assets
        .add_loading_state(
            LoadingState::new(GameStates::LoadingAssets)
                .continue_to_state(GameStates::GeneratingWorld)
                .with_collection::<GameAssets>(),
        )

by "adding add_loading_state" i got following error.

2022-09-09T16:45:40.985285Z  WARN bevy_ecs::schedule::graph_utils: Chain(bevy_ecs::schedule::state::State<game::game_states::GameStates>::on_enter::{{closure}}, bevy_ecs::schedule::state::should_run_adapter<game::game_states::GameStates>) wants to be after unknown label: game::game_states::GameStates
2022-09-09T16:45:40.985746Z  WARN bevy_ecs::schedule::graph_utils: Chain(bevy_ecs::schedule::state::State<game::game_states::GameStates>::on_update::{{closure}}, bevy_ecs::schedule::state::should_run_adapter<game::game_states::GameStates>) wants to be after unknown label: game::game_states::GameStates
thread 'main' panicked at 'Resource requested by bevy_ecs::schedule::state::State<game::game_states::GameStates>::on_enter::{{closure}} does not exist: bevy_ecs::schedule::state::State<game::game_states::GameStates>', C:\Users\ado\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_ecs-0.8.1\src\system\system_param.rs:349:17

Setup

[workspace]
# Important! wgpu/Bevy needs this!
resolver = "2"

[dependencies]
bevy = { version = "0.8.1", features = ["dynamic"] }
bevy-inspector-egui = "0.12.1"
bevy_editor_pls = {git = "https://github.com/jakobhellermann/bevy_editor_pls"}
rand = "0.8.5"
noise = "0.7.0"
bevy_asset_loader = "0.12"
iyes_progress = "0.5.0"
iyes_loopless = "0.7.1"

# Enable a small amount of optimization in debug mode
[profile.dev]
opt-level = 1

# Enable high optimization for dependencies (incl. Bevy), but not 
# for our code
[profile.dev.package."*"]
opt-level = 3
NiklasEi commented 1 year ago

You are missing the stageless feature from bevy_asset_loader. See https://github.com/NiklasEi/bevy_asset_loader#stageless-support

Trenrod commented 1 year ago

sorry looks like i can`t read correclty

image

fixed it.