pub struct EntityPriorityMut<'a, E: Copy + Eq + Hash> { /* private fields */ }Expand description
Mutable handle for reading and setting an entity’s priority in one priority layer. Lazy-creates a state entry on first write so set-and-forget works even before the entity enters scope for that user.
Returned by global_entity_priority_mut / user_entity_priority_mut on the
server, entity_priority_mut on the client, and their Bevy-adapter
passthroughs.
Implementations§
Source§impl<'a, E: Copy + Eq + Hash> EntityPriorityMut<'a, E>
impl<'a, E: Copy + Eq + Hash> EntityPriorityMut<'a, E>
Sourcepub fn accumulated(&self) -> f32
pub fn accumulated(&self) -> f32
Current accumulated priority value. Higher = more urgent. Returns 0.0 if no entry yet.
Sourcepub fn gain(&self) -> Option<f32>
pub fn gain(&self) -> Option<f32>
Current per-tick gain override. None means the default (1.0) applies.
Sourcepub fn is_overridden(&self) -> bool
pub fn is_overridden(&self) -> bool
Returns true if a per-tick gain override is currently active.
Sourcepub fn set_gain(&mut self, gain: f32) -> &mut Self
pub fn set_gain(&mut self, gain: f32) -> &mut Self
Set a persistent per-tick gain override for this layer. Stays in effect
until reset() or another set_gain() call. Lazy-creates the entry.
Sourcepub fn boost_once(&mut self, amount: f32) -> &mut Self
pub fn boost_once(&mut self, amount: f32) -> &mut Self
One-shot additive boost to the accumulator. Does not change gain. Multiple calls in one tick sum additively. Lazy-creates the entry. Persists across ticks until the entity is sent (then reset to 0).