Closed paulmasri closed 3 years ago
Hold fire! This isn't the only fix needed. I'm about to fix the example too.
OK. I think it's ready to go. 👀
Nope! Found another bug:
Generated events reference GameEvent<...>
instead of Event<...>
Sorry — I should have tested that last commit properly before pushing.
There's a problem with AddParentType()
because it expects a Type
argument that is a non-generic, but then that class name is used to add generics. It wasn't a problem before renaming Event
to GameEvent
, but now that the non-generic name does not match the generic name, AddParentType()
doesn't work properly.
If you give the type GameEvent
, it generates classes incorrectly, attempting to derive from lisandroct.EventSystem.GameEvent<...>
.
If you give the type Event
, it also generates classes incorrectly, attempting to derive from UnityEngine.Event<...>
.
I need to give this more thought (tomorrow). @lisandroct Maybe you have a suggestion?
Leaving aside AddParentType()
, what do you think about changing generic Event
to GameEvent
too? That way you reunify the naming of all events to consistent naming and avoid conflict with UnityEngine.Event
. And there would be no need to change the naming of generated events. e.g. BoolEvent
can remain BoolEvent
.
Leaving aside
AddParentType()
, what do you think about changing genericEvent
toGameEvent
too? That way you reunify the naming of all events to consistent naming and avoid conflict withUnityEngine.Event
. And there would be no need to change the naming of generated events. e.g.BoolEvent
can remainBoolEvent
.
This is true. I might do that.
I closed this by mistake but the fixes were merged. Thank you! I got rid of the 2019 example though.
Fixes #9