示例#1
0
        // 深度遍历移除 Sprite Image
        public static bool CheckComponent <T>(GameObject go_)
        {
            T com = go_.GetComponent <T>();

            if (com != null)
            {
                return(true);
            }

            int       childCount = go_.transform.childCount;
            int       idx        = 0;
            Transform childTrans = null;

            for (idx = 0; idx < childCount; ++idx)
            {
                childTrans = go_.transform.GetChild(idx);
                if (UtilApi.CheckComponent <T>(childTrans.gameObject))
                {
                    return(true);
                }
            }

            return(false);
        }