mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: NetworkScenePostProcess gives proper error message if currently in prefab edit mode. (#2467)
Previously it would give 'a scene needs to be resaved', which is confusing.
This commit is contained in:
parent
4ea25feee7
commit
b96d0d2284
@ -54,7 +54,19 @@ public static void OnPostProcessScene()
|
|||||||
}
|
}
|
||||||
// throwing an exception would only show it for one object
|
// throwing an exception would only show it for one object
|
||||||
// because this function would return afterwards.
|
// because this function would return afterwards.
|
||||||
else Debug.LogError("Scene " + identity.gameObject.scene.path + " needs to be opened and resaved, because the scene object " + identity.name + " has no valid sceneId yet.");
|
else
|
||||||
|
{
|
||||||
|
// there are two cases where sceneId == 0:
|
||||||
|
// * if we have a prefab open in the prefab scene
|
||||||
|
// * if an unopened scene needs resaving
|
||||||
|
// show a proper error message in both cases so the user
|
||||||
|
// knows what to do.
|
||||||
|
string path = identity.gameObject.scene.path;
|
||||||
|
if (string.IsNullOrWhiteSpace(path))
|
||||||
|
Debug.LogError($"{identity.name} is currently open in Prefab Edit Mode. Please open the actual scene before launching Mirror.");
|
||||||
|
else
|
||||||
|
Debug.LogError($"Scene {path} needs to be opened and resaved, because the scene object {identity.name} has no valid sceneId yet.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user