#Detecting entity changes

7 messages · Page 1 of 1 (latest)

mortal escarp
#

Is there a way to detect the following?

  • When a component is added to an entity
  • When a component is removed from an entity
  • When a component value changes (don't necessarily need the change, just that entity X component Y was modified)
  • When an entity is created
  • When an entity is deleted

My use case is the bevy editor. I want to be able to detect when the game changes, and update the UI appropriately. I don't want an immediate mode UI.

brittle rose
#

Check out the Added<C> and Changed<C> components. For removal, you can use RemovedComponents<C>, though this one has some major limitations

mortal escarp
#

Does Added work with Entity?

brittle rose
#

No, I don't think so.

mortal escarp
#

Hmm. Maybe something I'll have to modify bevy for, then.

brittle rose
#

someone asked a question specifically about detecting new entities. I think it was this week