Expand description
§bevy_full_asset_path
A tiny plugin that allows reading the full asset path of an asset loaded from disk
§Usage
Add FullAssetPathPlugin after DefaultPlugins, then use the FullAssetPathProvider resource to retrieve full paths:
use bevy::prelude::*;
use bevy_full_asset_path::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(FullAssetPathPlugin::default())
.add_systems(Startup, setup)
.run();
}
fn setup(asset_server: Res<AssetServer>, full_path_provider: Res<FullAssetPathProvider>) {
let sprite: Handle<Image> = asset_server.load("bird/icon.png");
let asset_path = sprite.path().unwrap();
let full_path = full_path_provider.full_asset_path(asset_path).unwrap();
info!("Full asset path: {}", full_path.display());
}Modules§
- prelude
- Everything you need to get started.
Structs§
- Full
Asset Path Plugin - The plugin that allows access to
FullAssetPathProvideron supported platforms. - Full
Asset Path Provider - If we’re using a
FileAssetReaderto read an asset, this resource will tell us the full path used to load something from a givenAssetPath.
Enums§
- Full
Asset Path Error - Error returned by
FullAssetPathProvider::full_asset_path.