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;
|
EventUnitView m_prefabEventUnitView;
|
||||||
|
|
||||||
public void Set(ReportGroup group) {
|
public void Set(ReportGroup group) {
|
||||||
foreach(Transform child in transform) {
|
foreach (Transform child in transform) {
|
||||||
child.SetParent(null, false);
|
|
||||||
Destroy(child.gameObject);
|
Destroy(child.gameObject);
|
||||||
}
|
}
|
||||||
foreach(var unit in group) {
|
foreach (var unit in group) {
|
||||||
Add(unit);
|
Add(unit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user