public CONSISTENCY_ANALYSE_ERROR_TYPE AnalyseSingleAtlasConsistent(AtlasProject project, out AtlasConsistencyAnalyseResult analyseResult) { CONSISTENCY_ANALYSE_ERROR_TYPE errorType = CONSISTENCY_ANALYSE_ERROR_TYPE.CONSISTENCY_ANALYSE_ERROR_NONE; analyseResult = null; if (null == project) { return(CONSISTENCY_ANALYSE_ERROR_TYPE.CONSISTENCY_ANALYSE_ERROR_TARGETPROJECT_ERROR); } errorType = CheckProjectConsistencyInfo(project, out analyseResult); return(errorType); }
private CONSISTENCY_ANALYSE_ERROR_TYPE CheckProjectConsistencyInfo(AtlasProject project, out AtlasConsistencyAnalyseResult analyseResult) { CONSISTENCY_ANALYSE_ERROR_TYPE errorType = CONSISTENCY_ANALYSE_ERROR_TYPE.CONSISTENCY_ANALYSE_ERROR_NONE; analyseResult = new AtlasConsistencyAnalyseResult(); if (null == project) { return(CONSISTENCY_ANALYSE_ERROR_TYPE.CONSISTENCY_ANALYSE_ERROR_TARGETPROJECT_ERROR); } PREFAB_EXIST_INFO prefabInfo = PREFAB_EXIST_INFO.PREFAB_FILE_EXIST_IN_SEARCHDIR; prefabInfo = CheckProjectWithoutPrefab(project); if (PREFAB_EXIST_INFO.PREFAB_FILE_NOT_EXIST == prefabInfo) {//Prefab不存在 AtlasConsistencyInfo consistencyInfo = new AtlasConsistencyInfo(); consistencyInfo.ConsistencyType = ATLASCONSISTENCY_TYPE.ATLAS_UNCONSISTENT_FOR_PREFAB_NOT_EXIST; consistencyInfo.AtlasFilePath = project.Path; analyseResult.AnalyseResult = ANALYSERESULT_TYPE.ANALYSERESULT_UNCONSISTENT; analyseResult.ConsistencyInfo.Add(consistencyInfo); } else {//prefab存在 bool isSpriteConsistent = true; List <SpriteConsistencyInfo> spriteConsistencyInfoTbl = null; CheckUnConsistentSpriteInProject(project, out isSpriteConsistent, out spriteConsistencyInfoTbl); if (isSpriteConsistent) { //sprite一致 if (PREFAB_EXIST_INFO.PREFAB_FILE_EXIST_NOTIN_SEARCHDIR == prefabInfo) { //Prefab不在查找目录内 AtlasConsistencyInfo consistencyInfo = new AtlasConsistencyInfo(); consistencyInfo.ConsistencyType = ATLASCONSISTENCY_TYPE.ATLAS_CONSISTENT_WITH_PREFAB_NOTIN_SEARCHPATH_WARNING; consistencyInfo.AtlasFilePath = project.Path; analyseResult.AnalyseResult = ANALYSERESULT_TYPE.ANALYSERESULT_CONSISTENT_WITH_WARNING; analyseResult.ConsistencyInfo.Add(consistencyInfo); } else { analyseResult.AnalyseResult = ANALYSERESULT_TYPE.ANALYSERESULT_CONSISTENT; } } else {//Sprite不一致 AtlasConsistencyInfo consistencyInfo = new AtlasConsistencyInfo(); if (PREFAB_EXIST_INFO.PREFAB_FILE_EXIST_NOTIN_SEARCHDIR == prefabInfo) {//Prefab不在查找目录内 consistencyInfo.ConsistencyType = ATLASCONSISTENCY_TYPE.ATLAS_UNCONSISTENT_FOR_SPRITE_NOT_SAME_WITH_PREFAB_NOTIN_SEARCHPATH_WARNING; } else {//Prefab在查找目录内 consistencyInfo.ConsistencyType = ATLASCONSISTENCY_TYPE.ATLAS_UNCONSISTENT_FOR_SPRITE_NOT_SAME; } consistencyInfo.AtlasFilePath = project.Path; consistencyInfo.SpriteConsistencyInfoTbl = spriteConsistencyInfoTbl; analyseResult.AnalyseResult = ANALYSERESULT_TYPE.ANALYSERESULT_UNCONSISTENT; analyseResult.ConsistencyInfo.Add(consistencyInfo); } } return(errorType); }
public CONSISTENCY_ANALYSE_ERROR_TYPE AnalyseAtlasConsistent(bool isNeedCheckPrefab, out AtlasConsistencyAnalyseResult analyseResult) { CONSISTENCY_ANALYSE_ERROR_TYPE errorType = CONSISTENCY_ANALYSE_ERROR_TYPE.CONSISTENCY_ANALYSE_ERROR_NONE; analyseResult = new AtlasConsistencyAnalyseResult(); InitProgresser(isNeedCheckPrefab); int count = 1; foreach (var item in m_projectTable) { AtlasConsistencyAnalyseResult singleAnalyseResult = null; AnalyseConsistencyProgresser.GetInstance().UpdateProgress(count++); errorType = CheckProjectConsistencyInfo(item, out singleAnalyseResult); if (IsAnalserFailed(errorType)) { continue; } if (singleAnalyseResult.AnalyseResult != ANALYSERESULT_TYPE.ANALYSERESULT_CONSISTENT) { analyseResult.ConsistencyInfo.AddRange(singleAnalyseResult.ConsistencyInfo); } } if (isNeedCheckPrefab) { bool isPrefabConsistent = false; List <AtlasConsistencyInfo> prefabWithoutProjectInfo = null; errorType = CheckPrefabConsistencyInfo(out isPrefabConsistent, out prefabWithoutProjectInfo); if (!IsAnalserFailed(errorType)) { if (!isPrefabConsistent) { analyseResult.ConsistencyInfo.AddRange(prefabWithoutProjectInfo); } } } foreach (var item in analyseResult.ConsistencyInfo) { if (ATLASCONSISTENCY_TYPE.ATLAS_CONSISTENT == item.ConsistencyType) { continue; } else if (ATLASCONSISTENCY_TYPE.ATLAS_CONSISTENT_WITH_PREFAB_NOTIN_SEARCHPATH_WARNING == item.ConsistencyType) { analyseResult.AnalyseResult = ANALYSERESULT_TYPE.ANALYSERESULT_CONSISTENT_WITH_WARNING; } else { analyseResult.AnalyseResult = ANALYSERESULT_TYPE.ANALYSERESULT_UNCONSISTENT; break; } } AnalyseConsistencyProgresser.GetInstance().UpdateProgress(count++); return(errorType); }