internal static void DestroyChild(GameObject parent, string name) { GameObject gameObject = NGUIUtil.FindChild(parent, name); if (gameObject) { gameObject.transform.parent = null; UnityEngine.Object.Destroy(gameObject); } }
internal static GameObject FindChild(GameObject go, string s) { if (go == null) { return(null); } foreach (Transform transform in go.transform) { if (transform.gameObject.name == s) { GameObject result = transform.gameObject; return(result); } GameObject gameObject = NGUIUtil.FindChild(transform.gameObject, s); if (gameObject) { GameObject result = gameObject; return(result); } } return(null); }
internal static Transform FindChild(Transform tr, string s) { return(NGUIUtil.FindChild(tr.gameObject, s).transform); }