NiklasEi / bevy_asset_loader

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

added absolute paths for types in macros #93

Closed thrombe closed 1 year ago

thrombe commented 1 year ago

the derive macro for AssetCollection trait assumes that bevy's World type among others is already in the scope

use bevy_asset_loader::prelude::AssetCollection;
#[derive(AssetCollection)] // cannot find World in this scope
struct Assets {
    #[asset(path = "images/image.png")]
    image: Handle<Image>,
}

but the error goes away when bevy prelude is imported.

use bevy::prelude::*;

use bevy_asset_loader::prelude::AssetCollection;
#[derive(AssetCollection)]
struct Assets {
    #[asset(path = "images/image.png")]
    image: Handle<Image>,
}