amethyst / amethyst/specs

Question: Lifetime for components

オープン
#717 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
2.6k
フォーク
215
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。