-
-
Notifications
You must be signed in to change notification settings - Fork 34
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 profiles reset and services reinitialized when already running #646
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What an odd issue, surprised we haven't hit it before.
Right? I'd like @StephenHodgson to verify this as well as it's his territory and I can't oversee side effects of this change. The question is what happens to changes made to profiles during play mode. I think they are saved to the assets nonetheless but XRTK will not automatically reinitialize when play mode is left. We might want to disable profile editing when in playmode at all. |
I'm fine merging this. Unity isn't really meant to be edited at runtime and resets everything back when you finish playing anyway. So I think this is fine. If you need to reset in runtime, you still can, just not while in the editor |
I guess this is fine for now, but I think it's just a temp fix for whatever you were running into. Can you give me a detailed bug report about it and a commit Sha I can checkout to reproduce it? |
You mean like the detailed log in this PR and the linked issue comment in the description? But you don't needs SHA, simply comment out the 4 lines and try the aforementioned replication steps linked |
I'd like a Sha commit just cause it was a lot going on. I didn't see the rest as I was doing a quick reply from the app. Didn't see the rest of the thread. Sorry. I'll do my best to check it out when I have a chance. Just seems like a cover up of an issue that could have been fixed a proper way. Again I think it's fine for now but we do want the ability to reset profiles at runtime later as we add more features |
It's a valid fix I think as I don't see any use case and scenario where you'd want a full reset of the service locator and all services etc. while the application is running. Also this affects only in-editor work. You can still do anything as before in a built player. This is only about fiddling with profiles in the inspector while the game is running. |
I'd still like to understand what was happening and why it wasn't a problem before now. |
I'll post a recording of what is going on over on Discord |
After reviewing this should be fine. I agree with Dino's original assessment. We probably shouldn't be resetting the service locator in playmode while in the editor |
XRTK - Mixed Reality Toolkit Pull Request
Overview
Fixes the issue reported by @SimonDarksideJ in the hands PR #552 (comment)
Changes
What would happen is that upon selecting / unfolding any data provider configuration in the profiles, while the application is in play mode, causes a full profile reset. This destroys all services and does a full reinitialization of the toolkit. As a side effect of this, the playspace would also get destroyed and recreated. It would then not appear in
DontDestroyOnLoad
collection anymore but in the base scene itself.To prevent these issues, I disabled resetting profiles when the application is running in editor play mode.