-
Notifications
You must be signed in to change notification settings - Fork 450
fix: NetworkManager doesn't destroy itself on multi instance #765
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
Conversation
… can now be overriden BREAKING CHANGE: Static lifecycle properties in NetworkBehaviour are no longer static
@@ -721,14 +721,6 @@ private void Awake() | |||
|
|||
private void OnEnable() | |||
{ | |||
if (Singleton != null && Singleton != this) | |||
{ | |||
Destroy(gameObject); |
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'm not super familiar with what this code does, but when I read the PR title I anticipated to see "if multi-scene, don't destroy, else still do" but what I see here is we don't destroy the game object anymore
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.
Yeah, it makes no sense for us to destroy it. I can't remember why I did it that way.
Basically what this used to do was:
If there was a NetworkManager already, destroy myself.
Now it doesn't destroy it anymore. That's the only difference.
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.
see my comments for 1 minor, 1 major changes.
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.
Other than the outstanding comments/request for change.
The rest looks good to me.
Co-authored-by: M. Fatih MAR <mfatihmar@gmail.com>
No description provided.