Editor script: find gameobjects, disconnected from prefab


How can I find all game objects in the scene, that have lost connection with prefab? Of course, I want to do it through editor script.

You have to iterate manually through all objects you want to test for a broken prefab connection and use PrefabUtility.GetPrefabType which returns a PrefabType value. This can be used to determine whether an object actually is linked to a prefab and if it has load it’s connection.

You might also want to take a look at the other function in the PrefabUtility class.