- Home /
Get path to prefab asset not from instance is not working :/
I need to compare prefab file from scene with prefab asset in project (calling it from prefab asset in project) I was comparing it in unity 2017 by comparing asset paths with:
string pathA = AssetDatabase.GetAssetPath(PrefabUtility.GetPrefabParent(sceneComp[i].gameObject)); string pathB = AssetDatabase.GetAssetPath(PrefabUtility.GetPrefabObject(myAsset.gameObject));
But in newest prefab system it is not working (GetCorrespondingObjectFromSource and GetPrefabInstanceHandle and others are not help here too), GetPrefabObject for asset prefab handles is discontinued but I really need to know if certain scene object is prefab of project asset prefab :/ Please help!
Comment