Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sorenbn opened this issue Sep 8, 2022 · 0 comments

Comments

@sorenbn
Copy link

sorenbn commented Sep 8, 2022

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

  • Clone project: https://github.com/sorenbn/extenject-bug
  • Open project and make a Windows build.
  • Play the game and click "Load Next Level" button.
  • Open the player log and notice Player(clone) has been destroyed on scene change and player is null when injected in the newly created scene.
    (C:\Users\USERNAME\AppData\LocalLow\DefaultCompany\extenject-bug\Player.log)

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):

  • Zenject version: Extenject-9.2.1 (from releases page, but version.txt says 9.1.0)
  • Unity version: 2021.3.8f1
  • Project's scripting backend [e.g. Mono/IL2CPP]: mono

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant