Esempio n. 1
0
 void InitConfig()
 {
     mConfig = ABBuilderTools.LoadAssetAtPath <AssetTargetConfig>(ABBuilderTools.AbConfigPath);
     if (mConfig == null)
     {
         mConfig = new AssetTargetConfig();
     }
     filterList = mConfig.filters;
 }
Esempio n. 2
0
 void ReadConfig()
 {
     config = ABBuilderTools.LoadAssetAtPath <AssetTargetConfig>(ABBuilderTools.AbConfigPath);
     if (config == null)
     {
         config = ScriptableObject.CreateInstance <AssetTargetConfig>();
         AssetDatabase.CreateAsset(config, ABBuilderTools.AbConfigPath);
     }
     else
     {
         config.Parse();
     }
 }
Esempio n. 3
0
    public static void AssetBundleMark(bool isPahtToGUID)
    {
        ABBuilder         builder = ABBuilderTools.Create(true);
        AssetTargetConfig config  = builder.config;
        int count = config.filters.Count;

        for (int i = 0; i < count; i++)
        {
            AssetTarget target = config.filters[i];
            if (EnAssetBundleExportType.Root != target.exportType)
            {
                continue;
            }
            ABBuilderTools.DisplayProgressBar("检查", i, count);
            switch (target.filterType)
            {
            case EnAssetBundleFilter.默认:
                config.SetChildDependenciesAssetBundle(target);
                break;

            case EnAssetBundleFilter.图片:
                config.SetIconAssetBundle(target);
                break;
            }
        }
        int rootCount = 0;

        count = config.filters.Count;
        Dictionary <string, bool> mergeMaps = new Dictionary <string, bool>();

        for (int i = 0; i < count; i++)
        {
            AssetTarget target = config.filters[i];
            if (target.exportType == EnAssetBundleExportType.None)
            {
                Loger.Error(string.Format("{0}->exportType is None", target.assetPath));
                return;
            }
            if (target.exportType != EnAssetBundleExportType.Asset)
            {
                if (target.exportType == EnAssetBundleExportType.RootMerge)
                {
                    if (!mergeMaps.ContainsKey(target.abPath))
                    {
                        mergeMaps[target.abPath] = true;
                        rootCount++;
                    }
                }
                else
                {
                    rootCount++;
                }
            }
            if (target.isChangeAbName)
            {
                ABBuilderTools.DisplayProgressBar("标记", i, count);
                target.UpdateAssetAbName();
            }
        }
        Loger.Error(string.Format("需要打包 -> {0} ", rootCount));
        builder.SaveConfig();
        ABBuilderTools.ClearProgressBar();
    }