VitalRouter icon indicating copy to clipboard operation
VitalRouter copied to clipboard

MapComponentInHierarchy Error

Open zhuxianzhiniko opened this issue 1 year ago • 1 comments

I registered in the root node LifetimeScope as follows

  builder.RegisterVitalRouter(routing =>
        {
            routing.MapComponentInHierarchy<A>();
      
        });
        builder.RegisterComponentInHierarchy(typeof(B));

After loading the new scene,I use autoInjectGameObjects to inject in the child node LifetimeScope. MapComponentInHierarchy is not working properly. RegisterComponentInHierarchy works fine.

zhuxianzhiniko avatar Feb 21 '24 08:02 zhuxianzhiniko

Hi, MapComponentInHierarchy actually calls RegisterComponentInHierarchy internally, so the behaviour does not seem to change. Also, what does 'not working properly' mean: does it mean that it is not injected, or that routing does not work?

Please send me a reproduction project if you like. Thanks.

hadashiA avatar Apr 08 '24 00:04 hadashiA