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(SharedMethods): find components in loading scenes #1759

Conversation

kristianpd
Copy link
Contributor

@kristianpd kristianpd commented Mar 28, 2018

I introduced a change to find even inactive objects in all scenes as opposed to just the currently loaded one (#1725).

In doing so I was assuming that the scene would be isLoaded by the time i wanted to do the search. As discovered by @bddckr, the Awake/Start methods run before the scene isLoaded and this resulted in the shared methods being unable to find certain components during Awake and Start.

This gets rid of that condition, since scenes retrieved using sceneCount and GetSceneAt are either loading or loaded.

This also refactors the method to avoid unnecessary iteration when only searching the active scene, and also renames the helper method.

@bddckr @thestonefox

@GitCop
Copy link

GitCop commented Mar 28, 2018

There were the following issues with your Pull Request

  • Commit: 23513dd
  • Your commit message body contains a line that is longer than 72 characters

Guidelines are available at https://github.com/thestonefox/SteamVR_Unity_Toolkit


This message was auto-generated by https://gitcop.com

@kristianpd kristianpd force-pushed the fix-loading-scene-sharedmethods branch from 23513dd to 64a5f38 Compare March 28, 2018 19:20
@GitCop
Copy link

GitCop commented Mar 28, 2018

There were the following issues with your Pull Request

  • Commit: 64a5f38
  • Your commit message body contains a line that is longer than 72 characters

Guidelines are available at https://github.com/thestonefox/SteamVR_Unity_Toolkit


This message was auto-generated by https://gitcop.com

Change finding components to look in scenes that are loading or loaded.
@kristianpd kristianpd force-pushed the fix-loading-scene-sharedmethods branch from 64a5f38 to 59951a2 Compare March 28, 2018 19:22
@thestonefox
Copy link
Member

@bddckr happy with this?

@thestonefox thestonefox merged commit 7aaf032 into ExtendRealityLtd:release/3.3.0-alpha Mar 30, 2018
@kristianpd kristianpd deleted the fix-loading-scene-sharedmethods branch April 8, 2018 16:54
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

4 participants