mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 18:00:26 +00:00
fix destroying a gameobject inside a prefab
This commit is contained in:
committed by
monitor1394
parent
e01c55c3ca
commit
773cfe6c7d
@@ -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