public void ClearChildern(EscalatorPro escalatorPro) { foreach (var item in escalatorPro.GetComponentsInChildren <Transform>()) { if (item != escalatorPro.transform) { DestroyImmediate(item.gameObject); } } }