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

Fix root startup timing due to undefined behavior before scene load #418

Merged
merged 1 commit into from Sep 26, 2022

Conversation

hadashiA
Copy link
Owner

@hadashiA hadashiA commented Sep 3, 2022

Problems

In my IOS build, if I try to Instantiate prefab before scene completion, it seems to return null.

VContainerSettings.OnEnable() currently uses preload assets, which seems to be in danger of being called before scene load.

Fix

Before

  1. Application startup
  2. VContainerSettings.OnEnable() <-- Configure the root scope
  3. Awake MonoBehaviours in first scene
  4. SceneManager.sceneLoaded
  5. Start

After

  1. Application startup
  2. VContainerSettings.OnEnable()
  3. Awake MonoBehaviours in first scene <-- Configure the root scope if any scope in the scene
  4. SceneManager.sceneLoaded <-- Configure the root scope if not yet
  5. Start

@vercel
Copy link

vercel bot commented Sep 3, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
vcontainer ✅ Ready (Inspect) Visit Preview Sep 3, 2022 at 11:48AM (UTC)

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