Ukendio / jecs

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

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

Closed DunnoConz closed 3 months ago

DunnoConz commented 4 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 3 months ago

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