Exemplo n.º 1
0
        public static void CheckSelectedCharacterTris()
        {
            bShowDetail = true;
            CCheckTools.ClearLogList();
            string[] filePath    = null;
            string   defaultPath = "";

            CCheckTools.GetSelectedFilePath(ref filePath, ref defaultPath, "*.FBX");
            if (filePath != null && filePath.Length > 0)
            {
                foreach (string s in filePath)
                {
                    CheckCharacterTris(s);
                }
            }
            else if (!string.IsNullOrEmpty(defaultPath))
            {
                CheckCharacterTris(defaultPath);
            }
            else
            {
                Debug.LogError("未选择任何文件");
            }
            CCheckTools.LogAll();
            CCheckTools.WriteAllInfoToFile(fileName, notice2);
        }
Exemplo n.º 2
0
        public static void CheckSelectedUVCount()
        {
            CCheckTools.ClearLogList();
            int curIndex = 0;
            int fileCount;

            string[] filePath    = null;
            string   defaultPath = "";

            CCheckTools.GetSelectedFilePath(ref filePath, ref defaultPath);
            if (filePath != null && filePath.Length > 0)
            {
                fileCount = filePath.Length;
                foreach (string s in filePath)
                {
                    curIndex++;
                    CCheckTools.DisplayProgressBar("检查中", s, curIndex / (float)fileCount);
                    CheckUVByPath(s);
                }
                CCheckTools.ClearProgressBar();
            }
            else if (!string.IsNullOrEmpty(defaultPath))
            {
                CheckUVByPath(defaultPath);
            }
            else
            {
                Debug.LogError("未选择任何文件");
            }
            CCheckTools.LogAll();
            CCheckTools.WriteAllInfoToFile(fileName, notice2);
        }
Exemplo n.º 3
0
        private static void CheckSelectedFileByType(string searchOption)
        {
            CCheckTools.ClearLogList();
            int index = 0;

            string[] filePath    = null;
            string   defaultPath = "";

            CCheckTools.GetSelectedFilePath(ref filePath, ref defaultPath, searchOption);
            if (filePath != null && filePath.Length > 0)
            {
                int fileCount = filePath.Length;
                foreach (string s in filePath)
                {
                    index++;
                    CCheckTools.DisplayProgressBar("检查中", index + "/" + fileCount + " " + s, index / (float)fileCount);
                    //CheckFile(s);
                    CheckChineseCharOrSpaceInFlieName(s);
                }
                CCheckTools.ClearProgressBar();
            }
            else if (!string.IsNullOrEmpty(defaultPath))
            {
                CheckFile(defaultPath);
            }
            else
            {
                Debug.LogError("未选择任何文件");
            }
            CCheckTools.LogAll();
            CCheckTools.WriteAllInfoToFile(fileName, "选中目录下,所有类型为" + searchOption + "且文件名包含空格的文件:");
        }
Exemplo n.º 4
0
        public static void CheckSelectedScenesLights()
        {
            bShowDetail = true;
            CCheckTools.ClearLogList();
            int curIndex = 0;

            string[] files       = null;
            string   defaultPath = "";

            CCheckTools.GetSelectedFilePath(ref files, ref defaultPath, "*.unity");
            if (files != null && files.Length > 0)
            {
                int fileCount = files.Length;
                foreach (string s in files)
                {
                    curIndex++;
                    CCheckTools.DisplayProgressBar("检查中", s, curIndex / (float)fileCount);
                    CheckSceneLights(s);
                }
                CCheckTools.ClearProgressBar();
            }
            else if (!string.IsNullOrEmpty(defaultPath))
            {
                CheckSceneLights(defaultPath);
            }
            else
            {
                Debug.LogError("未选择任何文件");
            }
            CCheckTools.LogAll();
            CCheckTools.WriteAllInfoToFile(fileName, notice2);
        }
Exemplo n.º 5
0
        public static void CheckRenameFile()
        {
            Debug.Log(notice1);
            string[] filePath    = null;
            string   defaultPath = "";
            int      curIndex    = 0;

            CCheckTools.GetSelectedFilePath(ref filePath, ref defaultPath);
            if (filePath != null && filePath.Length > 0)
            {
                fileCount = filePath.Length;
                string[] objArray = new string[filePath.Length]; //筛选文件并获取文件路径
                int      count    = 0;                           //待检查文件总数
                for (int i = 0; i < filePath.Length; i++)
                {
                    if (IsCheck(filePath[i]))
                    {
                        objArray[count++] = filePath[i];
                    }
                }
                fileCount = count * 2;
                curIndex  = count;

                CCheckTools.DisplayProgressBar("检查中", "快速排序...", 1 / 2.0f);
                //先排序,再找重名
                QuickSort(ref objArray, 0, count - 1);
                for (int i = 0; i < count; i++)
                {
                    curIndex++;
                    CCheckTools.DisplayProgressBar("检查中", objArray[i], curIndex / (float)fileCount);
                    if (i + 1 < count && GetObjLowerFileName(objArray[i]).Equals(GetObjLowerFileName(objArray[i + 1])))
                    {
                        string log = objArray[i];
                        while (i + 1 < count && GetObjLowerFileName(objArray[i]).Equals(GetObjLowerFileName(objArray[i + 1])))
                        {
                            log = log + "==" + objArray[i + 1];
                            i++;
                            curIndex++;
                        }
                        Debug.LogError(log);
                    }
                }
                CCheckTools.ClearProgressBar();
            }
            else
            {
                Debug.LogError("你没有选择文件夹或只选择了一个文件");
            }
        }
Exemplo n.º 6
0
        //[MenuItem("Assets/检查工具/检查选中场景的同名物体", false, 340)]
        //[MenuItem("检查工具/检查选中场景的同名物体", false, 340)]
        public static void CheckRenameComponentInSelectedScenes()
        {
            int fileCount;;
            int curIndex = 0;

            list = new List <GameObject>();

            string[] filePath    = null;
            string   defaultPath = "";

            CCheckTools.GetSelectedFilePath(ref filePath, ref defaultPath, "*.unity");
            if (filePath != null && filePath.Length > 0)
            {
                fileCount = filePath.Length;
                foreach (string s in filePath)
                {
                    curIndex++;
                    CCheckTools.DisplayProgressBar("检查中", s, curIndex / (float)fileCount);
                    CheckRenameComponent(s);
                }
                CCheckTools.ClearProgressBar();
            }
        }
Exemplo n.º 7
0
        public static void CheckSelectedImageSize()
        {
            mImageList.Clear();
            CCheckTools.ClearLogList();
            int fileCount = 0;
            int curIndex  = 0;

            string[] filePath    = null;
            string   defaultPath = "";

            CCheckTools.GetSelectedFilePath(ref filePath, ref defaultPath);
            if (filePath != null && filePath.Length > 0)
            {
                fileCount = filePath.Length;
                foreach (string s in filePath)
                {
                    curIndex++;
                    CCheckTools.DisplayProgressBar("检查中", s, curIndex / (float)fileCount);
                    CheckImageSize(s);
                }
                CCheckTools.ClearProgressBar();
            }
            else if (!string.IsNullOrEmpty(defaultPath))
            {
                CheckImageSize(defaultPath);
            }
            else
            {
                Debug.LogError("未选择任何文件");
            }
            CCheckTools.LogAll();
            CCheckTools.WriteAllInfoToFile(fileName, notice1);

            //savaInExcel(mImageList, CPath.OutPutPath, csvName);
            savaInExcel(mImageList, Application.dataPath + "/ToolsOutput/", mCsvName);
        }