pub trait AssetExtension {
// Required methods
fn add_asset<T: Asset>(&mut self) -> &mut Self;
fn add_asset_loader<T: AssetLoader>(&mut self, loader: T) -> &mut Self;
}Expand description
Add functionalities to add new Asset and new AssetLoader to the engine
Required Methods§
Sourcefn add_asset<T: Asset>(&mut self) -> &mut Self
fn add_asset<T: Asset>(&mut self) -> &mut Self
Add an Asset to the engine
This method create the Assets storage for the target Asset
register the Asset type to the AssetManager
and add a system to update the Assets storage when and Asset
is loaded or unloaded
Sourcefn add_asset_loader<T: AssetLoader>(&mut self, loader: T) -> &mut Self
fn add_asset_loader<T: AssetLoader>(&mut self, loader: T) -> &mut Self
Add an AssetLoader to the engine
This method register an asset loader to the AssetManager
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.