NiklasEi / bevy_asset_loader

Bevy plugin helping with asset loading and organization
Apache License 2.0
482 stars 53 forks source link

Calling `add_loading_state` panics `iyes_loopless` #89

Closed stevenctl closed 1 year ago

stevenctl commented 1 year ago
backtrace
thread 'main' panicked at 'State Transition Stage not found (assuming auto-added label)', /Users/landow/.cargo/registry/s
rc/github.com-1ecc6299db9ec823/iyes_loopless-0.7.1/src/state.rs:328:25
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_display
   3: core::panicking::panic_str
   4: core::option::expect_failed
   5: core::option::Option::expect
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/option.rs:738:21
   6: ::add_enter_system
             at /Users/landow/.cargo/registry/src/github.com-1ecc6299db9ec823/iyes_loopless-0.7.1/src/state.rs:328:25
   7: bevy_asset_loader::loading_state::LoadingState<S>::build
             at /Users/landow/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_asset_loader-0.12.1/src/loading_state.
rs:975:9
   8: ::add_loading_state
             at /Users/landow/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_asset_loader-0.12.1/src/loading_state.
rs:1078:9
   9: ::build
             at ./src/level_builder/mod.rs:20:9
  10: bevy_app::app::App::add_plugin
             at /Users/landow/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_app-0.8.1/src/app.rs:786:9
  11: bevy_experiment::game
             at ./src/main.rs:25:5
  12: bevy_experiment::main
             at ./src/main.rs:20:5

I've commented out pretty much every other plugin/system add other than these (main just adds this plugin then runs):

        app
            .add_loopless_state(GameState::AssetLoading)
            .add_plugins(DefaultPlugins)
            .add_loading_state(
                LoadingState::new(GameState::AssetLoading)
                    .continue_to_state(GameState::Playing)
                    .with_collection::<LevelBuilderAssets>(),
            )
            .add_enter_system(GameState::Playing, setup_lights)
            .add_enter_system(GameState::Playing, spawn_grid)
            .add_system_set(
                ConditionSet::new()
                    .run_in_state(GameState::Playing)
                    .with_system(hover_and_click)
                    .into(),
            );

I have the stageless feature enabled

bevy = { version = "0.8.1", features = ["dynamic"] }
bevy_asset_loader = { version = "0.12.1", features= ["stageless", "serde"] }
iyes_loopless = { version = "0.8.0"}

I hope I'm missing something obvious.

NiklasEi commented 1 year ago

bevy_asset_loader version 0.12.1 requires iyes_loopless version 0.7. There is no released version yet that supports iyes_loopless 0.8, but the main branch does.

stevenctl commented 1 year ago

Oh got it, thanks!

EDIT: seems to work well

NiklasEi commented 1 year ago

I just published version 0.13. With that, you can update to iyes_loopless version0.8.

stevenctl commented 1 year ago

Thanks!