Skip to content

Commit

Permalink
Add observer to Trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
bushrat011899 committed Sep 6, 2024
1 parent 54aa45e commit 7e476c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/bevy_ecs/src/observer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ impl<'w, E, B: Bundle> Trigger<'w, E, B> {
self.trigger.entity
}

/// Returns the entity that observed the triggered event.
pub fn observer(&self) -> Entity {
self.trigger.observer
}

/// Enables or disables event propagation, allowing the same event to trigger observers on a chain of different entities.
///
/// The path an event will propagate along is specified by its associated [`Traversal`] component. By default, events
Expand Down

0 comments on commit 7e476c9

Please sign in to comment.