예제 #1
0
        public void TextNoRaycast()
        {
            List <Text> textS = U_FindAll.GetAllT <Text>();
            int         i     = 0;

            foreach (var text in textS)
            {
                text.raycastTarget = false;
                i++;
            }
            Debug.Log("关闭了 " + i + " 个Text的射线截获");
        }
예제 #2
0
        public void ChangeAllFont()
        {
            List <Text> textS = U_FindAll.GetAllT <Text>();
            int         i     = 0;

            foreach (var text in textS)
            {
                if (text.font != targetFont)
                {
                    i++;
                    text.font = targetFont;
                }
            }
            Debug.Log("替换了 " + i + " 个Text的字体");
        }
        public void ChangeAllFont()
        {
            textS.Clear();
            textS = U_FindAll.GetAllT <Text>();
            int i = 0;

            foreach (var text in textS)
            {
                if (text.raycastTarget)
                {
                    i++;
                    text.raycastTarget = false;
                }
            }
            Debug.Log("有 " + i + " 个Text反勾选了raycastTarget");
        }
예제 #4
0
        public void ExcuteAll()
        {
            List <Transform> tranS = U_FindAll.GetAllT <Transform>();
            int i = 0;

            foreach (var tran in tranS)
            {
                if (tran.GetComponentsInChildren <MeshFilter>(true).Length == 0)
                {
                    Debug.Log("没有任何");
                    DestroyImmediate(tran.gameObject);
                    i++;
                }
            }
            Debug.Log("删除了 " + i + " 个空物体");
        }
예제 #5
0
        public void BtnColors()
        {
            List <Button> tS       = U_FindAll.GetAllT <Button>();
            int           i        = 0;
            ColorBlock    tarBlock = new ColorBlock();

            tarBlock.normalColor      = normalColor;
            tarBlock.highlightedColor = hoverColor;
            tarBlock.pressedColor     = pressedColor;
            tarBlock.colorMultiplier  = 1;
            tarBlock.fadeDuration     = 0.1f;

            foreach (var item in tS)
            {
                item.colors = tarBlock;
                i++;
            }
            Debug.Log(i + " 个Button改成了默认加重button");
        }
        public void DebugSameNameButton()
        {
            list.Clear();
            btnNameS.Clear();
            list = U_FindAll.GetAllT <Button>();
            int i = 0;

            foreach (var item in list)
            {
                if (!btnNameS.Contains(item.name))
                {
                    btnNameS.Add(item.name);
                }
                else
                {
                    i++;
                    Debug.Log(item.name + "   " + U_Transform.GetHierarchyPathName(item.transform));
                }
            }
            Debug.Log("共有 " + i + " 个重名的Button");
        }