This commit is contained in:
vis2k 2020-10-08 12:05:37 +02:00
parent 63540998c9
commit eeb1b3a469

View File

@ -906,13 +906,13 @@ public static void Spawn(GameObject obj, GameObject ownerPlayer)
static bool CheckForPrefab(GameObject obj)
{
#if UNITY_EDITOR
#if UNITY_2018_3_OR_NEWER
#if UNITY_2018_3_OR_NEWER
return UnityEditor.PrefabUtility.IsPartOfPrefabAsset(obj);
#elif UNITY_2018_2_OR_NEWER
#elif UNITY_2018_2_OR_NEWER
return (UnityEditor.PrefabUtility.GetCorrespondingObjectFromSource(obj) == null) && (UnityEditor.PrefabUtility.GetPrefabObject(obj) != null);
#else
#else
return (UnityEditor.PrefabUtility.GetPrefabParent(obj) == null) && (UnityEditor.PrefabUtility.GetPrefabObject(obj) != null);
#endif
#endif
#else
return false;
#endif