Struct amethyst_assets::PrefabLoader [−][src]
Helper structure for loading prefabs.
The recommended way of using this from States is to use world.exec.
Example
ⓘThis example is not tested
let prefab_handle = world.exec(|loader: PrefabLoader<SomePrefab>| { loader.load("prefab.ron", RonFormat, (), () });
Methods
impl<'a, T> PrefabLoader<'a, T> where
T: Send + Sync + 'static, [src]
impl<'a, T> PrefabLoader<'a, T> where
T: Send + Sync + 'static, pub fn load<F, N, P>(
&self,
name: N,
format: F,
options: F::Options,
progress: P
) -> Handle<Prefab<T>> where
F: Format<Prefab<T>>,
N: Into<String>,
P: Progress, [src]
pub fn load<F, N, P>(
&self,
name: N,
format: F,
options: F::Options,
progress: P
) -> Handle<Prefab<T>> where
F: Format<Prefab<T>>,
N: Into<String>,
P: Progress, Load prefab from source
pub fn load_from_data<P>(
&self,
data: Prefab<T>,
progress: P
) -> Handle<Prefab<T>> where
P: Progress, [src]
pub fn load_from_data<P>(
&self,
data: Prefab<T>,
progress: P
) -> Handle<Prefab<T>> where
P: Progress, Load prefab from explicit data
Trait Implementations
impl<'a, T> SystemData<'a> for PrefabLoader<'a, T> where
T: Send + Sync + 'static,
ReadExpect<'a, Loader>: SystemData<'a>,
Read<'a, AssetStorage<Prefab<T>>>: SystemData<'a>, [src]
impl<'a, T> SystemData<'a> for PrefabLoader<'a, T> where
T: Send + Sync + 'static,
ReadExpect<'a, Loader>: SystemData<'a>,
Read<'a, AssetStorage<Prefab<T>>>: SystemData<'a>, fn setup(res: &mut Resources)[src]
fn setup(res: &mut Resources)Sets up the system data for fetching it from the Resources.
fn fetch(res: &'a Resources) -> Self[src]
fn fetch(res: &'a Resources) -> SelfFetches the system data from Resources. Note that this is only specified for one concrete lifetime 'a, you need to implement the SystemData trait for every possible lifetime. Read more
fn reads() -> Vec<ResourceId>[src]
fn reads() -> Vec<ResourceId>Returns all read dependencies as fetched from Self::fetch. Read more
fn writes() -> Vec<ResourceId>[src]
fn writes() -> Vec<ResourceId>Returns all write dependencies as fetched from Self::fetch. Read more
Auto Trait Implementations
impl<'a, T> Send for PrefabLoader<'a, T>
impl<'a, T> Send for PrefabLoader<'a, T>impl<'a, T> Sync for PrefabLoader<'a, T>
impl<'a, T> Sync for PrefabLoader<'a, T>