Cysharp/MessagePipe

#120 AutoRegister Issues

amenonegames opened this issue · 0 comments

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's Publisher in ParentContainer 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