Exemplo n.º 1
0
    public REFERENCE_ANALYSE_ERROR_TYPE AnalyseNoneDependency(out NoneDependencyInfo noneDependencyInfo)
    {
        REFERENCE_ANALYSE_ERROR_TYPE errorType = REFERENCE_ANALYSE_ERROR_TYPE.REFERENCE_ANALYSE_ERROR_NONE;

        noneDependencyInfo = new NoneDependencyInfo();

        do
        {
            errorType = CheckNoneDependencyInput();
            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.CheckNoneDependencyAtlasFilter(item.Path))
                {
                    continue;
                }

                SpriteNoneRefInfo       spriteInfo = new SpriteNoneRefInfo();
                List <AtlasSpriteImage> spriteTbl  = item.GetAllSprites();

                foreach (var spriteItem in spriteTbl)
                {
                    string spriteName = Path.GetFileNameWithoutExtension(spriteItem.Path);

                    if (filter.CheckNoneDependencySpriteFilter(item.Path, spriteName))
                    {
                        continue;
                    }

                    if (spriteItem.ReferenceTable.Count == 0)
                    {
                        spriteInfo.NoneUseSpriteTbl.Add(spriteName);
                    }
                }

                if (spriteInfo.NoneUseSpriteTbl.Count == spriteTbl.Count)
                {
                    spriteInfo.IsAllUnUse = true;
                }

                noneDependencyInfo.NoneDependencyInfoTbl.Add(item.Path, spriteInfo);

                AnnalyseReferenceProgresser.GetInstance().UpdateProgress(count++);
            }
        }while(false);

        return(errorType);
    }
Exemplo n.º 2
0
    public REFERENCE_ANALYSE_ERROR_TYPE OpenAnalyseConfigFile(string configDir)
    {
        REFERENCE_ANALYSE_ERROR_TYPE errorType = REFERENCE_ANALYSE_ERROR_TYPE.REFERENCE_ANALYSE_ERROR_NONE;

        if (string.IsNullOrEmpty(configDir))
        {
            return(REFERENCE_ANALYSE_ERROR_TYPE.REFERENCE_ANALYSE_ERROR_CONFIGFILE_DIRPATH_ERROR);
        }

        AtlasReferenceFilter filter = new AtlasReferenceFilter(configDir);

        filter.OpenFilterConfigFile();

        return(errorType);
    }
Exemplo n.º 3
0
    public REFERENCE_ANALYSE_ERROR_TYPE AnalyseDependency(out DependencyInfo dependencyInfo)
    {
        REFERENCE_ANALYSE_ERROR_TYPE errorType = REFERENCE_ANALYSE_ERROR_TYPE.REFERENCE_ANALYSE_ERROR_NONE;

        dependencyInfo = new DependencyInfo();

        do
        {
            errorType = CheckDependencyInput();
            if (IsAnalserFailed(errorType))
            {
                break;
            }

            string configDir = UIAtlasEditorConfig.ReferenceResultPath;

            AtlasReferenceFilter filter = new AtlasReferenceFilter(configDir);

            List <string> assetPathTbl = GetAllAssetFilePath();

            AnnalyseReferenceProgresser.GetInstance().InitProgresser(assetPathTbl.Count, "正向引用导出中");
            int count = 1;

            foreach (var item in assetPathTbl)
            {
                AtlasReferenceInfo newInfo = null;

                if (
                    //YAMLAnalyser.IsAtlasPrefab(item)
                    !filter.CheckDependencyFilter(item)
                    )
                {
                    YAMLAnalyser.AnalyseAtlasReferenceInfo(item, out newInfo);
                    if (newInfo != null)
                    {
                        dependencyInfo.DependencyInfoTbl.Add(item, newInfo);
                    }
                }

                AnnalyseReferenceProgresser.GetInstance().UpdateProgress(count++);
            }
        } while (false);

        return(errorType);
    }