The package in the attachment contains everything to reproduce the bug. Open and run the 'Decorator Scene'.
To quickly describe the problem, there are two scenes, Main and Decorator. Main has a SceneContext while the Decorator has a DecoratorSceneContext. Both of these scenes have MonoBehaviour classes in them (MainSceneMono and DecoratorSceneMono) which expect dependencies from the other scene. The DecoratorSceneMono also has an Awake method which runs the 'SayHello()' method of the Foo class, which is bound in the Main Scene. Upon running the scene, the Awake method of the DecoratorSceneMono executes before the [Inject] Construct() method. Tests with Start() and OnEnable() have shown this execution order:
The package in the attachment contains everything to reproduce the bug. Open and run the 'Decorator Scene'.
To quickly describe the problem, there are two scenes, Main and Decorator. Main has a SceneContext while the Decorator has a DecoratorSceneContext. Both of these scenes have MonoBehaviour classes in them (MainSceneMono and DecoratorSceneMono) which expect dependencies from the other scene. The DecoratorSceneMono also has an Awake method which runs the 'SayHello()' method of the Foo class, which is bound in the Main Scene. Upon running the scene, the Awake method of the DecoratorSceneMono executes before the [Inject] Construct() method. Tests with Start() and OnEnable() have shown this execution order:
Awake() -> OnEnable() -> [Inject] Construct() -> Start()
[Unity Package] (https://github.com/modesttree/Zenject/files/3034209/DecoratorContext.zip)