Repository navigation
Getting dependencies from loaded scenes in unity #47
|
I'm designing a simple mobile unity app. I want to have start scene So basically my question is: how can I obtain lately registered dependencies for once resolved instance? |
Replies: 1 comment 5 replies
|
At var scene = SceneManager.LoadScene("MainMenuScene", new LoadSceneParameters(LoadSceneMode.Single));
ReflexSceneManager.PreInstallScene(scene, builder => builder.AddSingleton(MainMenuControllerInstance and MainMenuViewInstance)); |
So it seems in your case it depends on your implementation. Basically the container heirarchy is almost fully flat, except that all scene container inherits from the project container. Knowing that, "dependencies" on scene containers can depend on "dependencies" from project container, but the opposite is not true.
Container Hierarchy Example:
graph TD; ProjectContainer-->SceneOneContainer; ProjectContainer-->SceneTwoContainer; ProjectContainer-->SceneThreeContainer;