优化MultiComponentMode开启后的编辑体验和组件刷新 #128

This commit is contained in:
monitor1394
2021-03-13 04:21:52 +08:00
parent da305e3b7a
commit 04da71787b
4 changed files with 48 additions and 6 deletions

View File

@@ -124,6 +124,19 @@ namespace XCharts
GameObject.DestroyImmediate(go.gameObject);
}
}
public static void DestoryGameObjectByMatch(Transform parent, string match)
{
if (parent == null) return;
var childCount = parent.childCount;
for (int i = childCount - 1; i >= 0; i--)
{
var go = parent.GetChild(i);
if (go != null && go.name.StartsWith(match))
{
GameObject.DestroyImmediate(go.gameObject);
}
}
}
public static void DestoryGameObject(GameObject go)
{