amethyst / amethyst/specs

Question: Lifetime for components

Aperta
#717 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
2.6k
Fork
215
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I use a "lifetime" component to handle entity's removing. This is pretty easy, as I can iterate all entities with "Lifetime" component and check if lifetime is still valid, otherwise delete entity.

I want to have the same for components. Some components should only live for "x" seconds.

Do you have any idea how to implement this?

I first thought of a lazy_exec with time delay (just removing comp from entity). The solution should be similar to lazy Update, some "Read" resource which can be written in parallel.

I do not want to iterate over all components.
I do not want a lifetime field in every component.

Thanks

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.