If I get a scene Object and want to fetch the prefab Object it is instanced from and that prefab’s path.
The logic is first use
PrefabUtility.GetPrefabObject
to get the Object and then use AssetDatabase.GetAssetPath to get the path.
But it won’t work in unity,why?
And the “Object” if it is returned from PrefabUtility.GetPrefabObject cannot show in ObjectField.Why?
I find GetPrefabParent will do the trick.But why?
Weird enough.
Any guys has opinions are welcomed to explain this.