System parameter that writes typed messages into the ECS message bus.
// Source: https://github.com/bevyengine/bevy | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
use crate::{
message::{Message, MessageId, Messages, WriteBatchIds},
system::{ResMut, SystemAccess, SystemParam, SystemParamAccessConflict},
};
/// Writes [`Message`]s of type `T`.
///
/// This system parameter takes exclusive access to the [`Messages<T>`] resource,
/// so a system cannot also have a [`MessageReader`](super::MessageReader) parameter of the same type.
/// If you need to both read and write messages of the same type,
/// use [`MessageMutator`](super::MessageMutator).
///
/// # Usage
///
/// `MessageWriter`s are usually declared as a [`SystemParam`].
/// ```
/// # use bevy_ecs::prelude::*;
///
/// #[derive(Message)]
/// pub struct MyMes
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key