This commit is contained in:
vis2k 2021-02-18 13:56:26 +08:00
parent d8187d4b7d
commit 4624f34b0e

View File

@ -89,14 +89,14 @@ static void PrepareSceneObject(NetworkIdentity identity)
#if UNITY_2018_2_OR_NEWER
GameObject prefabGO = PrefabUtility.GetCorrespondingObjectFromSource(identity.gameObject);
#else
GameObject prefabGO = PrefabUtility.GetPrefabParent(identity.gameObject);
GameObject prefabGO = PrefabUtility.GetPrefabParent(identity.gameObject);
#endif
if (prefabGO)
{
#if UNITY_2018_3_OR_NEWER
GameObject prefabRootGO = prefabGO.transform.root.gameObject;
#else
GameObject prefabRootGO = PrefabUtility.FindPrefabRoot(prefabGO);
GameObject prefabRootGO = PrefabUtility.FindPrefabRoot(prefabGO);
#endif
if (prefabRootGO != null && prefabRootGO.GetComponentsInChildren<NetworkIdentity>().Length > 1)
{