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

Remove SteamManager call to DontDestroyOnLoad when component is not at root hierarchy. #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tichau
Copy link

@Tichau Tichau commented Oct 11, 2023

Fixes: Issue where a freeze on the main thead was occuring in il2cpp when the SteamManager was not at the root of the scene hierachy.

Calling DontDestroyOnLoad on an object that is not at the root of the hierarchy is not handled well by Unity, it generates a freeze on the main thread (specially on il2cpp targets) and a warning.

The fix in this MR does not call DontDestroyOnLoad if the game object is not at the root of the hierarchy to not take any reponsability on other objects. Another way to fix this issue can be to call DontDestroyOnLoad on the parent object (the one at the root of the hierarchy) or to assert that it is impossible to put this script on a child object.

…when the SteamManager was not at the root of the scene hierachy.
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

Successfully merging this pull request may close these issues.

None yet

1 participant