pub struct SpawnRequest {
pub template: AssetId,
pub name: Option<AssetId>,
pub transform: Transform,
pub lifetime_secs: Option<f32>,
}Expand description
Runtime-only event requesting that a copy of an existing placement be created in the world at runtime. The symmetric counterpart to DespawnRequest.
template names a placement already present in the world; the new instance
reuses that placement’s geometry and material at a fresh transform. A
name registers the instance so it can later be addressed (despawned,
reparented) like any authored placement; None spawns a transient copy,
like a Spawner’s cadence spawns. An optional lifetime_secs attaches a
Lifetime so the instance auto-despawns after that many seconds, the churn
that lets freed draw slots be recycled. GraphicsSystem reads these from its
Events<SpawnRequest> queue each step. World authors never declare this type
directly.
Fields§
§template: AssetIdThe placement to copy geometry and material from.
name: Option<AssetId>Name to register the instance under, or None for a transient copy.
transform: TransformWhere to place the new instance.
lifetime_secs: Option<f32>Seconds before the instance auto-despawns, when set.
Trait Implementations§
Source§impl Clone for SpawnRequest
impl Clone for SpawnRequest
Source§fn clone(&self) -> SpawnRequest
fn clone(&self) -> SpawnRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more