pub trait AnimationEventExt {
// Required methods
fn register_animation_trigger<T>(&mut self) -> &mut Self
where T: AnimationTriggerType,
<T as Event>::Trigger<'a>: for<'a> Default;
fn register_animation_window<T>(&mut self) -> &mut Self
where T: AnimationWindowType,
<T as Event>::Trigger<'a>: for<'a> Default;
}Expand description
Extension trait for registering animation trigger and window types.
§Example
ⓘ
use bevy::prelude::*;
use bevy_map_animation::{SpriteAnimationPlugin, AnimationEventExt};
App::new()
.add_plugins(SpriteAnimationPlugin)
.register_animation_trigger::<AttackHitbox>()
.register_animation_window::<ComboWindow>()
.run();Required Methods§
Sourcefn register_animation_trigger<T>(&mut self) -> &mut Self
fn register_animation_trigger<T>(&mut self) -> &mut Self
Register a custom trigger type for type-safe event handling
Sourcefn register_animation_window<T>(&mut self) -> &mut Self
fn register_animation_window<T>(&mut self) -> &mut Self
Register a custom window type for type-safe event handling
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.