pub enum EntityEvent {
Collision {
other_id: u64,
normal: Vector2D,
depth: f64,
},
TriggerEnter {
tag: String,
},
TriggerExit {
tag: String,
},
Spawn,
Destroy,
Custom {
name: String,
data: String,
},
}Expand description
Events that can be emitted by entities for inter-entity communication.
The event system allows decoupled game logic by enabling entities to broadcast events that other entities or systems can subscribe to.
Variants§
Collision
Emitted when the entity collides with another entity.
Fields
TriggerEnter
Emitted when the entity enters a trigger zone identified by a tag.
TriggerExit
Emitted when the entity exits a trigger zone identified by a tag.
Spawn
Emitted when the entity is spawned into the scene.
Destroy
Emitted when the entity is destroyed and removed from the scene.
Custom
A custom event with an arbitrary name and optional string data.
Trait Implementations§
Source§impl Clone for EntityEvent
impl Clone for EntityEvent
Source§fn clone(&self) -> EntityEvent
fn clone(&self) -> EntityEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EntityEvent
impl RefUnwindSafe for EntityEvent
impl Send for EntityEvent
impl Sync for EntityEvent
impl Unpin for EntityEvent
impl UnsafeUnpin for EntityEvent
impl UnwindSafe for EntityEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more