pub trait ConfigureLoadingState {
// Required methods
fn load_collection<A: AssetCollection>(self) -> Self;
fn init_resource<R: Resource + FromWorld>(self) -> Self;
fn register_dynamic_asset_collection<C: DynamicAssetCollection + Asset>(
self
) -> Self;
fn with_dynamic_assets_file<C: DynamicAssetCollection + Asset>(
self,
file: &str
) -> Self;
}Expand description
Methods to configure a loading state
Required Methods§
sourcefn load_collection<A: AssetCollection>(self) -> Self
fn load_collection<A: AssetCollection>(self) -> Self
Add the given collection to the loading state.
Its loading progress will be tracked. Only when all included handles are fully loaded, the collection will be inserted to the ECS as a resource.
See the two_collections example
sourcefn init_resource<R: Resource + FromWorld>(self) -> Self
fn init_resource<R: Resource + FromWorld>(self) -> Self
The resource will be initialized at the end of the loading state using its FromWorld implementation.
All asset collections will be available at that point and fully loaded.
See the init_resource example
sourcefn register_dynamic_asset_collection<C: DynamicAssetCollection + Asset>(
self
) -> Self
fn register_dynamic_asset_collection<C: DynamicAssetCollection + Asset>( self ) -> Self
Register a custom dynamic asset collection type
See the custom_dynamic_assets example
sourcefn with_dynamic_assets_file<C: DynamicAssetCollection + Asset>(
self,
file: &str
) -> Self
fn with_dynamic_assets_file<C: DynamicAssetCollection + Asset>( self, file: &str ) -> Self
Add a file containing dynamic assets to the loading state. Keys contained in the file, will be available for asset collections.
See the dynamic_asset example
Object Safety§
This trait is not object safe.