Ukendio / jecs

A fast, portable Entity Component System for Luau
https://ukendio.github.io/jecs/
MIT License
121 stars 20 forks source link

Adding a way to observe adding, setting, and removing components. #83

Closed DunnoConz closed 1 month ago

DunnoConz commented 2 months ago

Describe your Feature

A way to observe changes to entities within the world. The entities ECSOnAdd, ECSOnSet, and ECSOnRemove already exist for this feature request's purpose.

Implementation

Marcus said it would be used like this: Observer(Transform):event(OnAdd):on(function(entity, transform) end)

Considerations

Some questions that need to be answered include the following:

Ukendio commented 1 month ago

Solved with component hooks in https://github.com/Ukendio/jecs/pull/98