Skip to content

EventBindings Unregister #5

@soraphis

Description

@soraphis

the current readme makes it appear as if _onTestEvent.Listen = false; is not necessary OnDestroy (it sounds like it is only required if in an OnEnable/OnDisable fashion, so if my gameobject is never disabled and re-enabled it's fine), but it is!

a) Event Bindings need proper unregistration. this should be clear from the readme.
b) API wise, it feels weird to set the listen property to true/false and it's doing magic Register/Unregister behind the scenes. I'd rather have a Register() / Unregister() method exposed. or somethig like a Dispose() method to be called at the end of the lifetime.

The finalizer can't be used - sadly. since the registering of "this" in the EventBus keeps the EventBinding infinetly alive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions