From 26b476fa78fc727ed0e2d8738c5e15add983ef7b Mon Sep 17 00:00:00 2001 From: PopSlime Date: Fri, 14 Feb 2025 18:22:19 +0800 Subject: [PATCH] fix: Fix incorrect iteration when destroying game objects --- Assets/Cryville.EEW.Unity/UI/EventListView.cs | 1 - Assets/Cryville.EEW.Unity/UI/EventPropertyListView.cs | 1 - 2 files changed, 2 deletions(-) diff --git a/Assets/Cryville.EEW.Unity/UI/EventListView.cs b/Assets/Cryville.EEW.Unity/UI/EventListView.cs index 233c3ab..3e1709d 100644 --- a/Assets/Cryville.EEW.Unity/UI/EventListView.cs +++ b/Assets/Cryville.EEW.Unity/UI/EventListView.cs @@ -9,7 +9,6 @@ namespace Cryville.EEW.Unity.UI { public void Set(ReportUnit unit) { foreach (Transform child in transform) { - child.SetParent(null, false); Destroy(child.gameObject); } foreach (var e in unit) { diff --git a/Assets/Cryville.EEW.Unity/UI/EventPropertyListView.cs b/Assets/Cryville.EEW.Unity/UI/EventPropertyListView.cs index df390b8..d260078 100644 --- a/Assets/Cryville.EEW.Unity/UI/EventPropertyListView.cs +++ b/Assets/Cryville.EEW.Unity/UI/EventPropertyListView.cs @@ -9,7 +9,6 @@ namespace Cryville.EEW.Unity.UI { public void Set(IEnumerable> props) { foreach (Transform child in transform) { - child.SetParent(null, false); Destroy(child.gameObject); } foreach (var prop in props) {