gustavopsantos / Reflex

Minimal dependency injection framework for Unity
MIT License
730 stars 51 forks source link

Feat: Multi scene injection support #16

Closed Ragueel closed 1 year ago

Ragueel commented 2 years ago

Is your feature request related to a problem? Please describe. When scenes are loaded additively, objects inside them are not getting their dependencies resolved.

Describe the solution you'd like Maybe add a custom scene loading handler or custom scene manager.

Describe alternatives you've considered Listen to scene load events and resolve dependencies. Alternatively, exposing SceneInjector might do the trick.

gustavopsantos commented 1 year ago

@Ragueel Does your additive scenes have any SceneContext? Even without any intaller.

gustavopsantos commented 1 year ago

@Ragueel I think maybe you forgot about adding a SceneContext to your scene. If you read the documentation, SceneContext its not needed on all scenes, but, if you want Injection to happen once that scene is loaded, then you must have a SceneContext on it. Not reproducible.