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
Hi, recently I found out that some objects which class that has interface implemented would not able to correctly get the dependencies from scene context.(dependencies from project content can be perfectly resolved without any hassle.) For example, I have a class called EquipCardCtrler. It has Monohaviour class as base and ISlotItem as interface. One of its dependencies is called PrefabMgr. This dependency is dynamically bound in difference scenes. It would always cause error when those objects which classes with interface implemented got injected. It said a sort of message like the dependency graph cannot be resolved. I solved this issue by casting the object into its base class and then injecting.
For example:
....
var ctrler = aGameObj.GetComponent< EquipCardCtrler >();
diContainer.Inject(ctrler as MonoBehaviour);
....
Hope this can help someone who struggle with same issue.
The text was updated successfully, but these errors were encountered:
Hi, recently I found out that some objects which class that has interface implemented would not able to correctly get the dependencies from scene context.(dependencies from project content can be perfectly resolved without any hassle.) For example, I have a class called EquipCardCtrler. It has Monohaviour class as base and ISlotItem as interface. One of its dependencies is called PrefabMgr. This dependency is dynamically bound in difference scenes. It would always cause error when those objects which classes with interface implemented got injected. It said a sort of message like the dependency graph cannot be resolved. I solved this issue by casting the object into its base class and then injecting.
For example:
....
var ctrler = aGameObj.GetComponent< EquipCardCtrler >();
diContainer.Inject(ctrler as MonoBehaviour);
....
Hope this can help someone who struggle with same issue.
The text was updated successfully, but these errors were encountered: