More #if fixes (again)

This commit is contained in:
vis2k 2019-01-21 14:38:53 +01:00
parent 632cb1b483
commit e969fcf26c
2 changed files with 7 additions and 0 deletions

View File

@ -247,6 +247,11 @@ bool ThisIsASceneObjectWithPrefabParent(out GameObject prefab)
return false;
}
prefab = (GameObject)PrefabUtility.GetCorrespondingObjectFromSource(gameObject);
#elif UNITY_2018_2_OR_NEWER
PrefabType prefabType = PrefabUtility.GetPrefabType(gameObject);
if (prefabType == PrefabType.None)
return false;
prefab = (GameObject)PrefabUtility.GetCorrespondingObjectFromSource(gameObject);
#else
PrefabType prefabType = PrefabUtility.GetPrefabType(gameObject);
if (prefabType == PrefabType.None)

View File

@ -931,6 +931,8 @@ static bool CheckForPrefab(GameObject obj)
#if UNITY_EDITOR
#if UNITY_2018_3_OR_NEWER
return UnityEditor.PrefabUtility.IsPartOfPrefabAsset(obj);
#elif UNITY_2018_2_OR_NEWER
return (UnityEditor.PrefabUtility.GetCorrespondingObjectFromSource(obj) == null) && (UnityEditor.PrefabUtility.GetPrefabObject(obj) != null);
#else
return (UnityEditor.PrefabUtility.GetPrefabParent(obj) == null) && (UnityEditor.PrefabUtility.GetPrefabObject(obj) != null);
#endif