Macro bevy_defer::async_system

source ·
macro_rules! async_system {
    (|$($field: ident : $ty: ty),* $(,)?| $body: expr) => { ... };
}
Expand description

Construct an async system via the AsyncEntityParam abstraction.

§Syntax

§Example

// Set scale based on received position
let system = async_system!(|recv: Receiver<PositionChanged>, transform: AsyncComponent<Transform>|{
    let pos: Vec3 = recv.recv().await;
    transform.set(|transform| transform.scale = pos).await?;
})