Network ID Utility does not import correctly when GameObjects are disabled
tracked
Quap
The Network ID Utility exports Network IDs of disabled GameObjects but does not find the reference on import.
The import method is using the Find method of GameObject witch does not return disabled GameObjects.
I changed it to use the method below and now it finds all references as expected.
GameObject FindGameObjectWithNetworID(string path, Scene scene)
{
if(path.StartsWith("/"))
path = path.Substring(1);
GameObject[] rootGameObjects = scene.GetRootGameObjects();
foreach (GameObject rootGameObject in rootGameObjects)
{
if(rootGameObject.name == path)
return rootGameObject;
foreach (INetworkID nID in rootGameObject.GetComponentsInChildren<INetworkID>(true))
{
GameObject gameObject = (nID as Component).gameObject;
if (gameObject.transform.GetHierarchyPath() == path)
return gameObject;
}
}
return null;
}
Log In
Fax
tracked
G
Gahone
Where to paste that?