Exemplo n.º 1
0
        /// <summary>
        /// 返回Key为资源Path,Value为该资源所在的BundlePath字典
        /// </summary>
        /// <param name="splitPathListListDict"></param>
        private static Dictionary <string, string> BuildAssets(Dictionary <string, List <List <string> > > splitPathListListDict)
        {
            Dictionary <string, string> result = new Dictionary <string, string>();

            foreach (string entryPath in splitPathListListDict.Keys)
            {
                List <List <string> > assetPathListList = splitPathListListDict[entryPath];
                List <StrategyNode>   nodeList          = AssetBuildStrategyManager.GetAssetBuildStrategy(entryPath).nodeList;
                HashSet <string>      bundlePathSet     = new HashSet <string>();
                for (int i = 0; i < assetPathListList.Count; i++)
                {
                    Dictionary <string, string> bundlePathDict = AssetBundleBuilder.Add(entryPath, assetPathListList[i], nodeList[i]);
                    foreach (string k in bundlePathDict.Keys)
                    {
                        string path = ReplaceTemparyPath(k);
                        if (result.ContainsKey(path) == false)
                        {
                            result.Add(path, bundlePathDict[k]);
                        }
                        bundlePathSet.Add(bundlePathDict[k]);
                    }
                }
                AssetRecordHelper.RecordAssetDependency(entryPath, bundlePathSet.ToList <string>());
            }
            AssetBundleBuilder.Build();
            return(result);
        }
Exemplo n.º 2
0
 private static void Initialize()
 {
     TemporaryAssetHelper.Initialize();
     MaterialJsonData.Initialize();
     AssetBuildStrategyManager.Initialize();
     AssetBundleBuilder.Initialize();
     AssetRecordHelper.ReadAssetRecord();
     Logger.GetLogger(LOGGER_NAME).Level = Logger.LEVEL_LOG;
     _processedAssetPathSet = new HashSet <string>();
 }
Exemplo n.º 3
0
        private static List <List <string> > ProcessAsset(string path)
        {
            AssetBuildStrategy strategy = AssetBuildStrategyManager.GetAssetBuildStrategy(path);

            if (strategy != null)
            {
                return(AssetProcessor.ProcessAsset(path, strategy));
            }
            return(new List <List <string> >());
        }
Exemplo n.º 4
0
        private static bool IsBuildStrategyExists(string entryPath)
        {
            AssetBuildStrategy strategy = AssetBuildStrategyManager.GetAssetBuildStrategy(entryPath, false);

            if (strategy == null)
            {
                Logger.GetLogger(LOGGER_NAME).Log(string.Format("<color=#0000ff>未找到路径 {0} 对应的打包策略配置!</color>", entryPath));
                return(false);
            }
            return(true);
        }