コード例 #1
0
        internal static void DestroyChild(GameObject parent, string name)
        {
            GameObject gameObject = NGUIUtil.FindChild(parent, name);

            if (gameObject)
            {
                gameObject.transform.parent = null;
                UnityEngine.Object.Destroy(gameObject);
            }
        }
コード例 #2
0
 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);
 }
コード例 #3
0
 internal static Transform FindChild(Transform tr, string s)
 {
     return(NGUIUtil.FindChild(tr.gameObject, s).transform);
 }