Struct bevy_yoleck::YoleckBelongsToLevel
source · pub struct YoleckBelongsToLevel {
pub level: Entity,
}
Expand description
A marker for entities that belongs to the Yoleck level and should be despawned with it.
Yoleck already adds this automatically to entities created from the editor. The game itself should add this to entities created during gameplay, like bullets or spawned enemeis, so that they’ll be despawned when a playtest is finished or restarted.
When removing a YoleckKeepLevel
from entity (or removing the entire entity), Yoleck will
automatically despawn all the entities that have this component and point to that level.
There is no need to add this to child entities of entities that already has this marker,
because Yoleck will use despawn_recursive
when despawning these entities.
Fields§
§level: Entity
The entity which was used with YoleckLoadLevel
to
load the level that this entity belongs to.
Trait Implementations§
source§impl Clone for YoleckBelongsToLevel
impl Clone for YoleckBelongsToLevel
source§fn clone(&self) -> YoleckBelongsToLevel
fn clone(&self) -> YoleckBelongsToLevel
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Component for YoleckBelongsToLevel
impl Component for YoleckBelongsToLevel
source§const STORAGE_TYPE: StorageType = bevy::ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy::ecs::component::StorageType::Table
source§fn register_component_hooks(_hooks: &mut ComponentHooks)
fn register_component_hooks(_hooks: &mut ComponentHooks)
ComponentHooks
.Auto Trait Implementations§
impl Freeze for YoleckBelongsToLevel
impl RefUnwindSafe for YoleckBelongsToLevel
impl Send for YoleckBelongsToLevel
impl Sync for YoleckBelongsToLevel
impl Unpin for YoleckBelongsToLevel
impl UnwindSafe for YoleckBelongsToLevel
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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
source§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut Components, storages: &mut Storages, ids: &mut impl FnMut(ComponentId) )
unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> C
source§fn get_component_ids(
components: &Components,
ids: &mut impl FnMut(Option<ComponentId>)
)
fn get_component_ids( components: &Components, ids: &mut impl FnMut(Option<ComponentId>) )
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.