Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Assets/NavMeshComponents/Scripts/NavMeshSurface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,12 @@ bool UnshareNavMeshAsset()
return false;

// Prefab parent owns the asset reference
var prefabType = UnityEditor.PrefabUtility.GetPrefabType(this);
if (prefabType == UnityEditor.PrefabType.Prefab)
var prefabType = UnityEditor.PrefabUtility.GetPrefabAssetType(this);
if (prefabType != UnityEditor.PrefabAssetType.NotAPrefab)
return false;

// An instance can share asset reference only with its prefab parent
var prefab = UnityEditor.PrefabUtility.GetPrefabParent(this) as NavMeshSurface;
var prefab = UnityEditor.PrefabUtility.GetCorrespondingObjectFromSource(this) as NavMeshSurface;
if (prefab != null && prefab.navMeshData == navMeshData)
return false;

Expand Down