pub trait AddAsset {
fn add_asset<T>(&mut self) -> &mut Self
where
T: Asset;
fn add_debug_asset<T>(&mut self) -> &mut Self
where
T: Clone + Asset;
fn init_asset_loader<T>(&mut self) -> &mut Self
where
T: AssetLoader + FromWorld;
fn init_debug_asset_loader<T>(&mut self) -> &mut Self
where
T: AssetLoader + FromWorld;
fn add_asset_loader<T>(&mut self, loader: T) -> &mut Self
where
T: AssetLoader;
}
Expand description
App
extension methods for adding new asset types.
Required Methods
Registers T
as a supported asset in the application.
Adding the same type again after it has been added does nothing.
fn add_debug_asset<T>(&mut self) -> &mut Self where
T: Clone + Asset,
fn add_debug_asset<T>(&mut self) -> &mut Self where
T: Clone + Asset,
Registers T
as a supported internal asset in the application.
Internal assets (e.g. shaders) are bundled directly into the app and can’t be hot reloaded
using the conventional API. See DebugAssetServerPlugin
.
Adding the same type again after it has been added does nothing.
fn init_asset_loader<T>(&mut self) -> &mut Self where
T: AssetLoader + FromWorld,
fn init_asset_loader<T>(&mut self) -> &mut Self where
T: AssetLoader + FromWorld,
Adds an asset loader T
using default values.
The default values may come from the World
or from T::default()
.
fn init_debug_asset_loader<T>(&mut self) -> &mut Self where
T: AssetLoader + FromWorld,
fn init_debug_asset_loader<T>(&mut self) -> &mut Self where
T: AssetLoader + FromWorld,
Adds an asset loader T
for internal assets using default values.
Internal assets (e.g. shaders) are bundled directly into the app and can’t be hot reloaded
using the conventional API. See DebugAssetServerPlugin
.
The default values may come from the World
or from T::default()
.
fn add_asset_loader<T>(&mut self, loader: T) -> &mut Self where
T: AssetLoader,
fn add_asset_loader<T>(&mut self, loader: T) -> &mut Self where
T: AssetLoader,
Adds the provided asset loader to the application.