jeffcampbellmakesgames / Entitas-Redux

An entity-component framework for Unity with code generation and visual debugging
MIT License
102 stars 13 forks source link

[BUG] Attributes Event & CleanUp generates one unnecessary system #31

Closed TheHacky closed 3 years ago

TheHacky commented 3 years ago

Describe the bug When using the attributes Event and CleanUp for one component, an unnecessary system will be created. This system will destroy all entities with the listener component attached.

Unity Version: Unity 2019.4.12f1

To Reproduce

  1. Create a new component with at least one context and attributes Event(Self) & CleanUp(DestroyEntity)
  2. generate Code
  3. two cleanup systems were created

Expected behavior It should only create one cleanup system for the cleanup attribute and not a cleanup system for the event listener component.

jeffcampbellmakesgames commented 3 years ago

@TheHacky I've created a pull request (https://github.com/jeffcampbellmakesgames/Entitas-Redux/pull/34) that should resolve this issue if you'd like to review this beforehand, otherwise in a few days I will merge this to develop and create a new patch release v1.3.5 containing this fix.

TheHacky commented 3 years ago

Sry for late reply. Your PR is working as intended. (y)

jeffcampbellmakesgames commented 3 years ago

This has been merged to develop and released in v1.3.5 (https://github.com/jeffcampbellmakesgames/Entitas-Redux/releases/tag/upm%2Fv1.3.5). It should be available on OpenUPM shortly.