mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Force Network Manager to scene root if DDOL (#2936)
This commit is contained in:
parent
2d2710f60e
commit
60692f0373
@ -669,7 +669,13 @@ bool InitializeSingleton()
|
||||
}
|
||||
//Debug.Log("NetworkManager created singleton (DontDestroyOnLoad)");
|
||||
singleton = this;
|
||||
if (Application.isPlaying) DontDestroyOnLoad(gameObject);
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
// Force the object to scene root, in case user made it a child of something
|
||||
// in the scene since DDOL is only allowed for scene root objects
|
||||
transform.SetParent(null);
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user