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 + "且文件名包含空格的文件:"); }
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); }
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); }
public static void CheckAllMaterials() { CCheckTools.ClearLogList(); countStr.Clear(); repeatStr.Clear(); string[] files = Directory.GetFiles(CPath.AssetsApp, "*.*", SearchOption.AllDirectories); int fileCount = files.Length; int curIndex = 0; foreach (string f in files) { CCheckTools.DisplayProgressBar("处理中", f, curIndex / (float)fileCount); curIndex++; CheckMaterials(f); } foreach (string s in countStr) { CCheckTools.AddErrorInfo(s); } foreach (string s in repeatStr) { CCheckTools.AddErrorInfo(s); } CCheckTools.ClearProgressBar(); CCheckTools.LogAll(); CCheckTools.WriteAllInfoToFile(fileName, notice1); }
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); }
public static void CheckAllCharacterTris() { bShowDetail = false; CCheckTools.ClearLogList(); string[] files = Directory.GetFiles(CPath.AssetsAppArtCharacter, "*.FBX", SearchOption.AllDirectories); foreach (string f in files) { CheckCharacterTris(f); } CCheckTools.LogAll(); CCheckTools.WriteAllInfoToFile(fileName, notice1); }
public static void CheckALLUVCount() { CCheckTools.ClearLogList(); string[] files = Directory.GetFiles(CPath.AssetsApp, "*.*", SearchOption.AllDirectories); int fileCount = files.Length; int curIndex = 0; foreach (string f in files) { CCheckTools.DisplayProgressBar("处理中", f, curIndex / (float)fileCount); curIndex++; CheckUVByPath(f); } CCheckTools.ClearProgressBar(); CCheckTools.LogAll(); CCheckTools.WriteAllInfoToFile(fileName, notice1); }
public static void CheckAllCharacterBones() { CCheckTools.ClearLogList(); string[] files = Directory.GetFiles(CPath.AssetsAppArtCharacter, "*.FBX", SearchOption.AllDirectories); int fileCount = files.Length; int index = 0; foreach (string f in files) { CCheckTools.DisplayProgressBar("处理中", f, index / (float)fileCount); index++; CheckCharacterBones(f); } CCheckTools.ClearProgressBar(); CCheckTools.LogAll(); CCheckTools.WriteAllInfoToFile(fileName, notice1); }
private static void CheckAllFileByType(string searchOption) { CCheckTools.ClearLogList(); string[] files = Directory.GetFiles(defaultPathRoot, searchOption, SearchOption.AllDirectories); int fileCount = files.Length; int index = 0; foreach (string f in files) { CCheckTools.DisplayProgressBar("检查中", index + "/" + fileCount + " " + f, index / (float)fileCount); index++; //CheckFile(f); CheckChineseCharOrSpaceInFlieName(f); } CCheckTools.ClearProgressBar(); CCheckTools.LogAll(); CCheckTools.WriteAllInfoToFile(fileName, "所有类型为" + searchOption + "且文件名包含空格或汉字的文件:"); }
// 工具基本不使用,先注释掉菜单 //[MenuItem("Assets/程序/检查工具/检查选中目录下包含的文件类型", false, 02010041)] //[MenuItem("程序/检查工具/检查选中目录下包含的文件类型", false, 02010041)] public static void CheckFileType() { CCheckTools.ClearLogList(); int fileCount; int curIndex = 0; object[] objArray = Selection.GetFiltered(typeof(DefaultAsset), SelectionMode.Assets); if (null == objArray || objArray.Length == 0) { Debug.LogError("没有选中任何文件夹"); return; } string path = AssetDatabase.GetAssetPath(objArray[0] as Object); string[] files = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories); fileCount = files.Length; List <string> typeList = new List <string>(); foreach (string fp in files) { CCheckTools.DisplayProgressBar("检查中", fp, curIndex / (float)fileCount); curIndex++; if (fp.IndexOf('.') < 0) { continue; } string type = fp.Split('.')[fp.Split('.').Length - 1]; if (type.IndexOf('/') >= 0 || type.IndexOf('\\') >= 0) { continue; //排除xxx.xxx/yyy文件 } if (!typeList.Exists(s => s.Equals(type))) { typeList.Add(type); } } foreach (string s in typeList) { CCheckTools.AddLogInfo(s); } CCheckTools.LogAll(); CCheckTools.WriteAllInfoToFile("文件类型", "", CCheckTools.EFileType.txt); CCheckTools.ClearProgressBar(); }
public static void CheckAllImageSize() { mImageList.Clear(); CCheckTools.ClearLogList(); string[] files = Directory.GetFiles(CPath.AssetsApp, "*.*", SearchOption.AllDirectories); int fileCount = files.Length; int curIndex = 0; foreach (string f in files) { CCheckTools.DisplayProgressBar("处理中", f, curIndex / (float)fileCount); curIndex++; CheckImageSize(f); } CCheckTools.ClearProgressBar(); CCheckTools.LogAll(); CCheckTools.WriteAllInfoToFile(fileName, notice1); //savaInExcel(mImageList, CPath.OutPutPath, csvName); savaInExcel(mImageList, Application.dataPath + "/ToolsOutput/", mCsvName); }
public static void CheckAllScenesLights() { Debug.Log(notice1); bShowDetail = false; CCheckTools.ClearLogList(); int fileCount; string[] files = Directory.GetFiles(CPath.AssetsAppArtScenes, "*.unity", SearchOption.AllDirectories); fileCount = files.Length; int index = 0; foreach (string f in files) { CCheckTools.DisplayProgressBar("处理中", f, index / (float)fileCount); index++; CheckSceneLights(f); } CCheckTools.ClearProgressBar(); CCheckTools.LogAll(); CCheckTools.WriteAllInfoToFile(fileName, notice1); }
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); }