-
-
Notifications
You must be signed in to change notification settings - Fork 34
updated playmode/editor mode change transitions #704
updated playmode/editor mode change transitions #704
Conversation
Disable and destroy all services as soon as we get the quitting event
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.
Makes sense, testing will tell :D
@@ -274,7 +274,12 @@ private void InitializeInstance() | |||
DontDestroyOnLoad(instance.transform.root); | |||
} | |||
|
|||
Application.quitting += () => IsApplicationQuitting = true; | |||
Application.quitting += () => |
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.
I wouldn't have used a lambda here but I guess it's too late.
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.
Why not?
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.
Just a personal preference. Application exit and cleanup is an important event and imo deserves a proper method definition. That makes it for others easier to find the code executed when the toolkit is "deinitialized" in the future, instead of having to find it somewhere in between other code.
But as I said, it's not super important. I just wouldn't have done it.
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.
It's an event you can subscribe to anywhere. We do provide this public flag for if the application is quitting via the property, but I don't really think it makes a difference if the Application.quitting
event can be subscribed from anywhere in the codebase
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.
I think you misunderstood. All I am saying is I'd create a definition private void MixedRealityToolkit_OnQuitting()
in MixedRealityToolkit
instead of an anonymous method. Because that way if someone is looking up "What does the XRTK do, when the application quits?", it is much easier to find. All good.
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.
Now that makes sense !👍
* updated playmode/editor mode change transitions Disable and destroy all services as soon as we get the quitting event * use nameof * fixed project manifest * properly use nameof * fixed tests
XRTK - Mixed Reality Toolkit Pull Request
Overview
nameof