Skip to content

Commit 72d0e22

Browse files
committed
Fixed double separators appearing in prefab instances
Flatten is called twice for prefab instances present in the scene: first when prefab is edited, and second when the scene hierarchy is processed. This caused double --- wrappers appearing when "Replace with separator" option was chosen.
1 parent 4909dfb commit 72d0e22

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Runtime/Folder.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,12 @@ private void HandleSelf(StrippingMode strippingMode, bool capitalizeFolderName)
222222
{
223223
if (strippingMode == StrippingMode.ReplaceWithSeparator)
224224
{
225-
name = $"--- {(capitalizeFolderName ? name.ToUpper() : name)} ---";
225+
// If the folder name is already a separator, don't change it.
226+
if ( ! name.StartsWith("--- "))
227+
{
228+
name = $"--- {(capitalizeFolderName ? name.ToUpper() : name)} ---";
229+
}
230+
226231
return;
227232
}
228233

0 commit comments

Comments
 (0)