public static void DestoryInstance()
 {
     if (m_Instance != null)
     {
         m_Instance = null;
         AnalyseConsistencyProgresser.DestoryInstance();
     }
 }
 public static AnalyseConsistencyProgresser GetInstance()
 {
     if (m_Instance == null)
     {
         m_Instance = new AnalyseConsistencyProgresser();
     }
     return(m_Instance);
 }
示例#3
0
    private void InitProgresser(bool isNeedCheckPrefab)
    {
        int projectNum = m_projectTable.Count;

        if (isNeedCheckPrefab)
        {
            AnalyseConsistencyProgresser.GetInstance().InitProgresser(projectNum + 1, "一致性分析中");
        }
        else
        {
            AnalyseConsistencyProgresser.GetInstance().InitProgresser(projectNum, "一致性分析中");
        }
    }
示例#4
0
    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);
    }