AnimationEventExt

Trait AnimationEventExt 

Source
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§

Source

fn register_animation_trigger<T>(&mut self) -> &mut Self
where T: AnimationTriggerType, <T as Event>::Trigger<'a>: for<'a> Default,

Register a custom trigger type for type-safe event handling

Source

fn register_animation_window<T>(&mut self) -> &mut Self
where T: AnimationWindowType, <T as Event>::Trigger<'a>: for<'a> Default,

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.

Implementations on Foreign Types§

Source§

impl AnimationEventExt for App

Source§

fn register_animation_trigger<T>(&mut self) -> &mut App
where T: AnimationTriggerType, <T as Event>::Trigger<'a>: for<'a> Default,

Source§

fn register_animation_window<T>(&mut self) -> &mut App
where T: AnimationWindowType, <T as Event>::Trigger<'a>: for<'a> Default,

Implementors§