jeffcampbellmakesgames / Entitas-Redux

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

Genesis error when trying to use Events #10

Closed HollowGraphic closed 4 years ago

HollowGraphic commented 4 years ago

Adding [Event()] attribute to any component causes Genesis to fail with an error stating "Value cannot be null. Parameter name: element"

jeffcampbellmakesgames commented 4 years ago

What is the full type for [Event()]? Is this related to EntitasRedux? I'm wondering if this is supposed to be an issue on the Unity COC library, Genesis, or EntitasRedux

jeffcampbellmakesgames commented 4 years ago

I don't believe COC uses Genesis, which makes me think this issue might belong on a different repository.

HollowGraphic commented 4 years ago

JCMG.EntitasRedux.EventAttribute is the full type

jeffcampbellmakesgames commented 4 years ago

Cool, thanks @HollowGraphic! I will transfer this issue to that repository and take a look later today. Thanks for reporting!

jeffcampbellmakesgames commented 4 years ago

@HollowGraphic Can you post an example of the component that's experiencing this issue with the full stacktrace of the error please? I see that there is an event component example and when testing code-generation currently this does not result in any issues.

HollowGraphic commented 4 years ago

[Event(EventTarget.Self, EventType.Added)] [Event(EventTarget.Self, EventType.Removed)] [Game] public class Active : IComponent { }

Trace:

jeffcampbellmakesgames commented 4 years ago

I can see two issues here:

The fix for this should be pretty straightforward for both; as far as an ETA I'll see if I can knock this out later tonight and post an updated package for both Genesis and EntitasRedux. This will require updating your package to the latest at that point.

HollowGraphic commented 4 years ago

Sweet, I'll keep an eye out

jeffcampbellmakesgames commented 4 years ago

Both of these issues have been resolved for Genesis and EntitasRedux and a new version v1.2.2 is available that should resolve these issues. Let me know how this works for you!

HollowGraphic commented 4 years ago

Awesome, I'll keep you posted.

HollowGraphic commented 4 years ago

No errors. All event systems and components are being generated.

jeffcampbellmakesgames commented 4 years ago

No errors. All event systems and components are being generated.

Excellent. I am closing this out as complete then.