pub enum AudioFileEndBehavior {
Nothing,
RemoveComponents,
Despawn {
recursive: bool,
},
}
Expand description
Describe how the audio components (and entity) will react to the audio source reaching the end of the file.
Variants§
Nothing
Do nothing. This is the default behavior.
RemoveComponents
Remove all components in the AudioFileBundle
. This will also clean up audio resources.
Despawn
Despawn the entity as a whole. This is only useful for cases where the entity only serves as an audio source, will yeet your entity out of the world.
Trait Implementations§
source§impl Clone for AudioFileEndBehavior
impl Clone for AudioFileEndBehavior
source§fn clone(&self) -> AudioFileEndBehavior
fn clone(&self) -> AudioFileEndBehavior
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Component for AudioFileEndBehavior
impl Component for AudioFileEndBehavior
source§const STORAGE_TYPE: StorageType = bevy::ecs::component::StorageType::SparseSet
const STORAGE_TYPE: StorageType = bevy::ecs::component::StorageType::SparseSet
A constant indicating the storage type used for this component.
§fn register_component_hooks(_hooks: &mut ComponentHooks)
fn register_component_hooks(_hooks: &mut ComponentHooks)
Called when registering this component, allowing mutable access to its [
ComponentHooks
].source§impl Debug for AudioFileEndBehavior
impl Debug for AudioFileEndBehavior
source§impl Default for AudioFileEndBehavior
impl Default for AudioFileEndBehavior
source§fn default() -> AudioFileEndBehavior
fn default() -> AudioFileEndBehavior
Returns the “default value” for a type. Read more
impl Copy for AudioFileEndBehavior
Auto Trait Implementations§
impl Freeze for AudioFileEndBehavior
impl RefUnwindSafe for AudioFileEndBehavior
impl Send for AudioFileEndBehavior
impl Sync for AudioFileEndBehavior
impl Unpin for AudioFileEndBehavior
impl UnwindSafe for AudioFileEndBehavior
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
§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
§fn get_component_ids(
components: &Components,
ids: &mut impl FnMut(Option<ComponentId>)
)
fn get_component_ids( components: &Components, ids: &mut impl FnMut(Option<ComponentId>) )
Gets this [
Bundle
]’s component ids. This will be None
if the component has not been registered.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
fn get_components(self, func: &mut impl FnMut(StorageType, OwningPtr<'_>))
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self
using data from the given [World
].