pub enum TnuaToggle {
Disabled,
SenseOnly,
Enabled,
}
Expand description
Allows disabling Tnua for a specific entity.
This can be used to let some other system temporarily take control over a character.
This component is not mandatory - if omitted, Tnua will just assume it is enabled for that entity.
Variants§
Disabled
Do not update the sensors, and do not apply forces from the motor.
The controller system will also not run and won’t update the motor components not the state
stored in the TnuaController
component. They will retain their last value from before
TnuaToggle::Disabled
was set.
SenseOnly
Update the sensors, but do not apply forces from the motor.
The platformer controller system will still run and still update the motor components and
state stored in the TnuaController
component. only the system that applies the motor
forces will be disabled.
Enabled
The backend behaves normally - it updates the sensors and applies forces from the motor.
Trait Implementations§
source§impl Clone for TnuaToggle
impl Clone for TnuaToggle
source§fn clone(&self) -> TnuaToggle
fn clone(&self) -> TnuaToggle
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Component for TnuaToggle
impl Component for TnuaToggle
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
.source§impl Debug for TnuaToggle
impl Debug for TnuaToggle
source§impl Default for TnuaToggle
impl Default for TnuaToggle
source§fn default() -> TnuaToggle
fn default() -> TnuaToggle
source§impl PartialEq for TnuaToggle
impl PartialEq for TnuaToggle
source§fn eq(&self, other: &TnuaToggle) -> bool
fn eq(&self, other: &TnuaToggle) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for TnuaToggle
impl Eq for TnuaToggle
impl StructuralPartialEq for TnuaToggle
Auto Trait Implementations§
impl Freeze for TnuaToggle
impl RefUnwindSafe for TnuaToggle
impl Send for TnuaToggle
impl Sync for TnuaToggle
impl Unpin for TnuaToggle
impl UnwindSafe for TnuaToggle
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.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
fn get_components(self, func: &mut impl FnMut(StorageType, OwningPtr<'_>))
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World
.