You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the solution you'd like
A function describing whether an effect spawner has more particles to spawn without reset() being called.
/// Get whether the spawner is active.////// Inactive spawners do not spawn any particle.pubfnhas_more_to_spawn(&self) -> bool{ifself.active{ifself.limit.is_finite(){self.active}else{self.spawn_remainder > 1.}}else{self.active}}
Describe why you want that solution. Is this related to a problem?
I would like to remove expired particle spawners after some time:
Describe alternatives you've considered
Just despawn entities after a known time limit. This change would just allow users to track or infer fewer parameters themselves.
The text was updated successfully, but these errors were encountered:
jpedrick
changed the title
EffectSpawner::is_active to report if particles will be spawned
EffectSpawner:: has_more_to_spawn to report if particles will be spawned
Feb 13, 2024
jpedrick
added a commit
to jpedrick/bevy_hanabi
that referenced
this issue
Feb 13, 2024
I looked again at this, I'm ok in principle I think, but the proposed implementation looks problematic. An "active" spawner is already defined conceptually as a spawner which ticks, irrelevant of whether or not more particle can be spawned. So a Spawner::rate() for example, which is infinite, would return has_more_to_spawn() == false if paused (set inactive) which feels wrong, if only because in your use case @jpedrick you'd despawn it even though it's not "finished". Thoughts?
Describe the solution you'd like
A function describing whether an effect spawner has more particles to spawn without
reset()
being called.Describe why you want that solution. Is this related to a problem?
I would like to remove expired particle spawners after some time:
Describe alternatives you've considered
Just despawn entities after a known time limit. This change would just allow users to track or infer fewer parameters themselves.
The text was updated successfully, but these errors were encountered: