Skip to content

Commit

Permalink
Potentially fixed prefabs dying when referencing stuff outside prefabs
Browse files Browse the repository at this point in the history
  • Loading branch information
rurre committed Feb 29, 2024
1 parent c3a72f4 commit 2b76fb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Editor/Copiers/GenericCopier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,11 @@ public static void CopyPrefabs(CopyInstance inst, bool createGameObjects, bool a
Component[] prefComponents = toPref.GetComponentsInChildren<Component>(true);
foreach(var comp in prefComponents)
{
if(fixReferences)
FixReferencesOnComponent(comp, tFrom, tTo, createGameObjects);
if(fixReferences)
{
var refs = GetReferencesToFixLater(comp, tFrom, tTo, createGameObjects);
inst.propertyRefs.Add(refs);
}

if(adjustScale)
{
Expand Down
2 changes: 1 addition & 1 deletion Editor/Helpers/PumkinsHelperFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ public static void SelectAndPing(string assetPath)
if(newTrans)
newComp = newTrans.GetComponent<T>();
else if(setNullIfNotFound)
PumkinsAvatarTools.Log($"Couldn't find object for <b>{prop.displayName}</b> in <b>{newHierarchyRoot.name}</b>'s hierarchy", LogType.Warning);
PumkinsAvatarTools.Log($"Couldn't find object for property <b>{prop.propertyPath}</b> in <b>{newHierarchyRoot.name}</b>'s hierarchy", LogType.Warning);
else
continue;
}
Expand Down

0 comments on commit 2b76fb0

Please sign in to comment.