pub struct Scene {
pub asset_id: AssetId,
pub camera_shot: Option<AssetId>,
}Expand description
A named group of world content.
Props belong to a Scene by naming convention: props whose name
begins with <scene_name>_ are associated with that Scene. Props not
prefixed by any scene name are visible in every scene.
The first declared Scene is active at world start. Scene changes are driven
by actions: a UI scene:<name> action (HitRegion /
KeyBinding) or a Behavior scene node jumps to
the named scene, with the transition (“Cut” or “FadeBlack”) declared on the
jump.
Fields§
§asset_id: AssetIdAsset identity; injected via inject_name. Not part of args.
camera_shot: Option<AssetId>A CameraShot or Camera3D to activate when
this scene becomes active. None keeps the current camera unchanged.
Trait Implementations§
Source§impl Component for Scene
impl Component for Scene
Source§fn inject_name(&mut self, id: AssetId)
fn inject_name(&mut self, id: AssetId)
Called after construction to inject the asset’s identity from the blob
def. Only meaningful for components that look themselves up by id at
runtime. The default implementation does nothing.
Source§fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
Reconstruct this component from a blob record, whose bytes are the
serialized runtime component (cook already ran the asset -> component
translation). The default rejects: runtime-only components are never
stored in a blob, so only loadable types provide an implementation.
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Called after construction to inject the payload locator from the blob def.
Only meaningful for components with a compiled payload.
The default implementation does nothing (correct for most components).
Source§impl ComponentSlot for Scene
impl ComponentSlot for Scene
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
The component type’s stable id, used as its
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<Self>
fn slot(s: &ComponentStorage) -> &Column<Self>
Borrow this type’s column out of the storage.
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<Self>
Mutably borrow this type’s column out of the storage.
Source§impl<'de> Deserialize<'de> for Scene
impl<'de> Deserialize<'de> for Scene
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Scene> for ComponentAsset
impl From<Scene> for ComponentAsset
impl RuntimeComponent for Scene
Auto Trait Implementations§
impl Freeze for Scene
impl RefUnwindSafe for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl UnsafeUnpin for Scene
impl UnwindSafe for Scene
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more