private static void SearchABFile(string assetFile) { string[] dependencies = AssetDatabase.GetDependencies(assetFile, true); if (dependencies != null) { for (int i = 0; i < dependencies.Length; i++) { if (!dependencies[i].EndsWith(".cs") && !dependencies[i].EndsWith(".meta")) { ABFile abFile; if (dicABFile.TryGetValue(dependencies[i], out abFile)) { //找出来的依赖有可能是自己 if (assetFile != dependencies[i] && !abFile.isRefByFile(assetFile)) { abFile.refByFiles.Add(assetFile); } } else { abFile = new ABFile(); abFile.refByFiles.Add(assetFile); dicABFile.Add(dependencies[i], abFile); SearchABFile(dependencies[i]); } } } } }
private static void AddConfigFileABFile(string file, string bundleName) { if (string.IsNullOrEmpty(bundleName)) { Debug.LogError("文件" + file + "的bundleName不能为空"); return; } file = PathTools.FormatPath(file); string assetFile = PathTools.PathToUnityAssetPath(file); ABFile abFile; if (!dicABFile.TryGetValue(assetFile, out abFile)) { abFile = new ABFile(); abFile.bundleName = bundleName; dicABFile.Add(assetFile, abFile); } }