Differenciate in-scene object from loaded object when using Resources.FindObjectsOfTypeAll


I'm getting lists of objects by using Resources.FindObjectsOfTypeAll, and I'd like to differentiate those that are instantiated in the current scene from those which are merely "loaded". In the editor, I do that by checking the PrefabType of the object (EditorUtility.GetPrefabType; if Prefab or ModelPrefab then it's an asset, not a scene object), however this is editor only. Any idea how to do that at runtime?

Note: I need to use Resources.FindObjectsOfTypeAll because this will return inactive gameObjects, which is what I want.



Simple and fast solution would be to attach a script to your prefabs with a public boolean variable. Then in the Start function of this script set the boolean value to true. So when you store your objects of the type you can check the boolean variable of each and store those with true value in a separate array.