trigger_entity_internal

Function trigger_entity_internal 

Source
pub unsafe fn trigger_entity_internal(
    world: DeferredWorld<'_>,
    observers: &CachedObservers,
    event: PtrMut<'_>,
    trigger: PtrMut<'_>,
    target_entity: Entity,
    trigger_context: &TriggerContext,
)
Expand description

Trigger observers watching for the given entity event. The target_entity should match the EntityEvent::event_target on event for logical correctness.

§Safety

  • observers must come from the world DeferredWorld, and correspond to observers that match the event type
  • event must point to an Event
  • trigger must correspond to the Event::Trigger type expected by the event
  • trigger_context’s TriggerContext::event_key must correspond to the event type.
  • Read, understand, and abide by the Trigger safety documentation