You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently shifted from Zenject v5.4 to Zenject 6+.
I understand that using AsSingle across multiple statements is not suitable anymore, I have been able to adapt the changes in most cases barring the following with interfaces.
I used the following way to install certain bindings while using v5.4
This used to only create a single instance of Prefab. But in Zenject 6+ it creates a duplicate Prefab too. Switching the latter to AsCached doesn't work either.
Since Interfaces are binding to different ResultType I cant do something like this either: Container.Bind<typeof(IFoo), typeof(IBar)>().To<Z>().FromComponentInNewPrefab(Prefab).AsSingle();
Is this the intended behavior now ? If Yes, then Is there a way now to get the same behavior as present in v5.4 ?
The text was updated successfully, but these errors were encountered:
I recently shifted from Zenject v5.4 to Zenject 6+.
I understand that using AsSingle across multiple statements is not suitable anymore, I have been able to adapt the changes in most cases barring the following with interfaces.
I used the following way to install certain bindings while using v5.4
Container.Bind<IFoo>().To<Foo>().FromComponentInNewPrefab(Prefab).AsSingle();
Container.Bind<IBar>().To<Bar>().FromComponentInNewPrefab(Prefab).AsSingle();
This used to only create a single instance of
Prefab
. But in Zenject 6+ it creates a duplicate Prefab too. Switching the latter toAsCached
doesn't work either.Since Interfaces are binding to different ResultType I cant do something like this either:
Container.Bind<typeof(IFoo), typeof(IBar)>().To<Z>().FromComponentInNewPrefab(Prefab).AsSingle();
Is this the intended behavior now ? If Yes, then Is there a way now to get the same behavior as present in v5.4 ?
The text was updated successfully, but these errors were encountered: