Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#120 AutoRegister Issues #127

Open
amenonegames opened this issue Apr 30, 2024 · 0 comments
Open

#120 AutoRegister Issues #127

amenonegames opened this issue Apr 30, 2024 · 0 comments

Comments

@amenonegames
Copy link

amenonegames commented Apr 30, 2024

I am reporting a problem I encountered in v 1.14.0. #120 This is related to the automatic resolution of ISubscriber<> and IPublisher<>.

I am using MessagePipe along with a tiered VContainer.
For example, a ParentContainer (SceneContainer) with a ChildContainer (EnemyContainer) placed under it.
So, when an event occurs in ChildContainer, you may want to notify ParentContainer of it.
For example, when an Enemy dies and spawns a drop item, this kind of messaging would allow us to keep the Enemy and the spawned item separate.
I used this method a lot.

Until now, if I had not written a RegisterMessageBroker in ChildContainer, the MessageHandler in ParentContainer's Publisher was automatically Injected to EventTrigger in ChildContainer.
However, with the automatic resolution of ISubscriber<> and IPublisher<>, even if the RegisterMessageBroker is not written in ChildContainer, it will be automatically registered, and the automatically generated MessageHandler generated automatically in ChildContainer will be injected.

Events that occur in ChildContainer are not notified to the ParentContainer's Handler, and the expected behavior is not achieved.

Is there an option to disable auto-registration in some Containers?
Or is the design itself not very good to try to separate functions using messaging in this manner?

--my environment
Unity2022.3.10
VContainer1.15.4
MessagePipe1.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant