public void GetChildHierarchyDebug(ref string sOutput, int nDepth) { string sIndent = ""; nDepth++; for (int j = 0; j < nDepth; j++) { sIndent += " "; } for (int i = 0; i < ChildCount; i++) { Sprite sp = GetChildByIndex(i); sOutput += sIndent + sp.Name + "\r\n"; sp.GetChildHierarchyDebug(ref sOutput, nDepth); } }