fix: Fix incorrect iteration when destroying game objects
This commit is contained in:
@@ -7,11 +7,10 @@ namespace Cryville.EEW.Unity.UI {
|
||||
EventUnitView m_prefabEventUnitView;
|
||||
|
||||
public void Set(ReportGroup group) {
|
||||
foreach(Transform child in transform) {
|
||||
child.SetParent(null, false);
|
||||
foreach (Transform child in transform) {
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
foreach(var unit in group) {
|
||||
foreach (var unit in group) {
|
||||
Add(unit);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user