INNER CODE UNIT · Rust
create_prefab
shawnscode/crayon · modules/world/src/lib.rs:46
pub fn create_prefab(prefab: Prefab) -> Result<PrefabHandle> {
ctx().create_prefab(prefab)
}
/// Create a prefab object from file asynchronously.
///
/// A prefab asset acts as a template from which you can create new entity instances
/// in the world. It stores a entity and its children complete with components and
/// properties internally.
#[inline]
pub fn create_prefab_from<T: AsRef<str>>(url: T) -> Result<PrefabHandle> {
ctx().create_prefab_from(url)
}
/// Return the prefab obejct if exists.
#[inline]
pub fn prefab(handle: PrefabHandle) -> Option<Arc<Prefab>> {
ctx().prefab(handle)