mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-19 15:00:08 +00:00
fix destroying a gameobject inside a prefab
This commit is contained in:
committed by
monitor1394
parent
54ee3d43f5
commit
16c8d26e2a
@@ -72,12 +72,12 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
public static void DestoryAllChilds(Transform parent)
|
||||
public static void DestroyAllChildren(Transform parent)
|
||||
{
|
||||
while (parent.childCount > 0)
|
||||
{
|
||||
var go = parent.GetChild(0);
|
||||
if (go.childCount > 0) DestoryAllChilds(go);
|
||||
if (go.childCount > 0) DestroyAllChildren(go);
|
||||
else GameObject.DestroyImmediate(go.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user