From 9effef23a852bf521b862c0a55f3705adec8c23a Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sun, 5 Mar 2023 00:26:07 +0900 Subject: [PATCH] fix: Clear does not clear elements --- Internal/PrefabSafeSet/Editor/EditorUtil.PrefabModification.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Internal/PrefabSafeSet/Editor/EditorUtil.PrefabModification.cs b/Internal/PrefabSafeSet/Editor/EditorUtil.PrefabModification.cs index 597b1e64d..8ec1ef9fb 100644 --- a/Internal/PrefabSafeSet/Editor/EditorUtil.PrefabModification.cs +++ b/Internal/PrefabSafeSet/Editor/EditorUtil.PrefabModification.cs @@ -251,7 +251,7 @@ public void DoInitialize() public override void Clear() { Initialize(); - for (var i = _elements.Count - 1; i >= _upstreamElementCount; i--) + for (var i = _elements.Count - 1; i >= 0; i--) _elements[i].EnsureRemoved(); _currentAdditionsSize = _currentAdditions.arraySize = 0; }