fix: Fix incorrect iteration when destroying game objects
This commit is contained in:
@@ -9,7 +9,6 @@ namespace Cryville.EEW.Unity.UI {
|
|||||||
|
|
||||||
public void Set(ReportUnit unit) {
|
public void Set(ReportUnit unit) {
|
||||||
foreach (Transform child in transform) {
|
foreach (Transform child in transform) {
|
||||||
child.SetParent(null, false);
|
|
||||||
Destroy(child.gameObject);
|
Destroy(child.gameObject);
|
||||||
}
|
}
|
||||||
foreach (var e in unit) {
|
foreach (var e in unit) {
|
||||||
|
@@ -9,7 +9,6 @@ namespace Cryville.EEW.Unity.UI {
|
|||||||
|
|
||||||
public void Set(IEnumerable<Localized<ReportViewModelProperty>> props) {
|
public void Set(IEnumerable<Localized<ReportViewModelProperty>> props) {
|
||||||
foreach (Transform child in transform) {
|
foreach (Transform child in transform) {
|
||||||
child.SetParent(null, false);
|
|
||||||
Destroy(child.gameObject);
|
Destroy(child.gameObject);
|
||||||
}
|
}
|
||||||
foreach (var prop in props) {
|
foreach (var prop in props) {
|
||||||
|
Reference in New Issue
Block a user