Mathijs-Bakker / Extenject

Dependency Injection Framework for Unity Game Engine
MIT License
531 stars 97 forks source link

Project Context fails to inject properly in newly loaded scene on Windows build only. #52

Open sorenbn opened 2 years ago

sorenbn commented 2 years ago

Describe the bug There is an issue when changing scenes and the newly loaded scene is trying to resolve its dependencies from the project context, on windows build only. Instances (monobehaviours) bound from the project context seems to be destroyed on scene change (this can be seen in the logs) even though they are present in the "DontDestroyOnLoad" scene. The problem only occurs in windows builds. It works as intended in the editor itself.

To Reproduce

Expected behavior Expected behaviour should be as the edtior behaviour. Player object should not be destroyed, and the scene context should be able to resolve its dependencies without trouble.

Extenject and Unity info (please complete the following information):

Additional context When downgrading to old Zenject version (9.0.0) the bug is not present and the behaviour works as expected.