private void AnalyseReverseDependcyInfo(ReverseDependencyInfo reverseDependencyInfo, out List <string> csvData) { csvData = new List <string>(); if (null == reverseDependencyInfo) { return; } foreach (var infoItem in reverseDependencyInfo.ReverseDependencyInfoTbl) { csvData.Add(infoItem.Key); foreach (var spriteItem in infoItem.Value.SpriteRefTbl) { csvData.Add("," + spriteItem.Key); foreach (var assetItem in spriteItem.Value) { csvData.Add("," + "," + assetItem); } csvData.Add(""); } csvData.Add(Environment.NewLine); } }
public REFERENCE_ANALYSE_ERROR_TYPE AnalyseReverseDependency(out ReverseDependencyInfo reverseDependencyInfo) { REFERENCE_ANALYSE_ERROR_TYPE errorType = REFERENCE_ANALYSE_ERROR_TYPE.REFERENCE_ANALYSE_ERROR_NONE; reverseDependencyInfo = new ReverseDependencyInfo(); do { errorType = CheckReverseDependencyInput(); if (IsAnalserFailed(errorType)) { break; } string configDir = UIAtlasEditorConfig.ReferenceResultPath; AtlasReferenceFilter filter = new AtlasReferenceFilter(configDir); AnnalyseReferenceProgresser.GetInstance().InitProgresser(m_inputInfo.ProjectTbl.Count, "反向引用导出中"); int count = 1; foreach (var item in m_inputInfo.ProjectTbl) { if (filter.CheckReverseDependencyAtlasFilter(item.Path)) { continue; } SpriteReverseRefInfo newSpriteInfo = new SpriteReverseRefInfo(); List <AtlasSpriteImage> spriteTbl = item.GetAllSprites(); foreach (var spriteItem in spriteTbl) { string spriteName = Path.GetFileNameWithoutExtension(spriteItem.Path); if (filter.CheckReverseDependencySpriteFilter(item.Path, spriteName)) { continue; } if (spriteItem.ReferenceTable.Count > 0) { newSpriteInfo.SpriteRefTbl.Add(spriteName, spriteItem.ReferenceTable); } } if (newSpriteInfo.SpriteRefTbl.Count > 0) { reverseDependencyInfo.ReverseDependencyInfoTbl.Add(item.Path, newSpriteInfo); } AnnalyseReferenceProgresser.GetInstance().UpdateProgress(count++); } }while(false); return(errorType); }
public void ExportReverseDependency(string resultdir, ReverseDependencyInfo reverseDependencyInfo) { if ( (null == reverseDependencyInfo) || string.IsNullOrEmpty(resultdir) ) { return; } List <string> csvData = null; AnalyseReverseDependcyInfo(reverseDependencyInfo, out csvData); WriteReverseDependencyCSVFile(resultdir, csvData); }
public REFERENCE_ANALYSE_ERROR_TYPE AnalyseAllDependency(out AllDependencyInfo allDependencyInfo) { REFERENCE_ANALYSE_ERROR_TYPE errorType = REFERENCE_ANALYSE_ERROR_TYPE.REFERENCE_ANALYSE_ERROR_NONE; allDependencyInfo = new AllDependencyInfo(); DependencyInfo dependencyInfo = null; ReverseDependencyInfo reverseDependencyInfo = null; NoneDependencyInfo noneDependencyInfo = null; do { errorType = AnalyseDependency(out dependencyInfo); if (IsAnalserFailed(errorType)) { break; } errorType = AnalyseReverseDependency(out reverseDependencyInfo); if (IsAnalserFailed(errorType)) { break; } errorType = AnalyseNoneDependency(out noneDependencyInfo); if (IsAnalserFailed(errorType)) { break; } allDependencyInfo.AtlasDependencyInfo = dependencyInfo; allDependencyInfo.AtlasrRverseDependencyInfo = reverseDependencyInfo; allDependencyInfo.AtlasrNoneDependencyInfo = noneDependencyInfo; }while(false); return(errorType); }