NiklasEi / bevy_asset_loader

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

Loading `TextureAtlas` without attribute throws silent error #145

Closed 100-TomatoJuice closed 1 year ago

100-TomatoJuice commented 1 year ago

When trying to load a TextureAtlas without a texture_atlas attribute, like

#[asset(path = "atlas.png")]
pub texture_atlas: Handle<TextureAtlas>

the loader says that the asset is loaded even though attempting to use the Handle causes nothing to render.

NiklasEi commented 1 year ago

As far as I can see there is not much we can do about this at the moment. Getting a handle from a string path will not carry the asset type information, so Bevy cannot know that we are asking for the wrong asset type.

Maybe this will change with Assets v2, but for now I will close this.