AnimationState

Trait AnimationState 

Source
pub trait AnimationState: Animation {
    type StateQuery<'w, 's>: ReadOnlyQueryData;

    // Required method
    fn update_state(
        animator: &mut Animator<Self>,
        data: &<Self::StateQuery<'_, '_> as WorldQuery>::Item<'_>,
    );
}
Expand description

This trait is used to allow animations to update their state based on the compenent the animation is attached to.

Required Associated Types§

Source

type StateQuery<'w, 's>: ReadOnlyQueryData

The query that will allow the animation to read data from the component it is attached to.

Required Methods§

Source

fn update_state( animator: &mut Animator<Self>, data: &<Self::StateQuery<'_, '_> as WorldQuery>::Item<'_>, )

This method will update the state of the animation based on the data from the component it is attached to.

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.

Implementors§