NiklasEi / bevy_asset_loader

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

texture_atlas_layout not work with ron #211

Open darkautism opened 2 months ago

darkautism commented 2 months ago
fn main() {
    App::new()
        .init_state::<MyStates>()
        .add_plugins(DefaultPlugins)
        .add_plugins(RonAssetPlugin::<Story>::new(&["novel.ron"]))
        .add_loading_state(
            LoadingState::new(MyStates::AssetLoading)
                .continue_to_state(MyStates::Next)
                .with_dynamic_assets_file::<StandardDynamicAssetCollection>(
                    "test.assets.ron",
                )
                .load_collection::<MyAssets>(),
        )
        .run();
}

#[derive(AssetCollection, Resource, Debug)]
struct MyAssets {
    #[asset(key = "storys", collection(typed))]
    pub storys: Vec<Handle<Story>>,

    #[asset(texture_atlas_layout(tile_size_x = 960., tile_size_y = 200., columns = 5, rows = 3))]
    pub npc_dialog_textarea: Handle<TextureAtlasLayout>,
}

It will response

thread 'main' panicked at C:\Users\kautism\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_asset_loader-0.20.1\src\standard_dynamic_asset.rs:242:30:
No Handle for path

If remove TextureAtlasLayout, It not happened.