public AssetBundleBuildSearchInfo(string searchDirectory, XmlElement element) { this.searchDirectory = searchDirectory; string st = element.GetAttribute("packingType"); if (st == "Whole") { this.packingType = AssetBundlePackingType.Whole; this.assetBundleName = "{DirPath}/{DirName}"; } else if (st == "SubDir") { this.packingType = AssetBundlePackingType.SubDir; this.assetBundleName = "{SubDirPath}/{SubDirName}"; } else if (st == "SingleFile") { this.packingType = AssetBundlePackingType.SingleFile; this.assetBundleName = "{FilePath}"; } else if (st == "Lua") { this.packingType = AssetBundlePackingType.Lua; this.assetBundleName = "{DirPath}/{DirName}"; } else { throw new Exception("Unknown AssetBundleBuildSearchType " + st); } this.isOnlyMoveFile = element.GetAttribute("onlyMoveFile") == "true"; this.isOnlyTopDir = element.GetAttribute("onlyTopDir") == "true"; if (element.GetAttribute("assetBundleName") != "") { this.assetBundleName = element.GetAttribute("assetBundleName"); } if (element.GetAttribute("ignoreDirNames") != "") { this.ignoreDirNames = element.GetAttribute("ignoreDirNames").Split(','); } string filters = element.GetAttribute("assetFilters"); if (filters != null && filters != null) { this.assetFilters = filters.Split(','); } string mainType = element.GetAttribute("mainAssetType"); if (mainType != null && mainType != "") { this.mainAssetType = mainType; } }
public AssetBundleBuildInfo(XmlElement element) { searchDirectory = element.GetAttribute("searchDirectory").Replace("\\", "/"); if (searchDirectory.EndsWith("/")) { searchDirectory.Substring(0, searchDirectory.Length - 1); } bundleNameExt = element.GetAttribute("bundleNameExt"); if (string.IsNullOrEmpty(bundleNameExt)) { bundleNameExt = ""; } packingType = (AssetBundlePackingType)Enum.Parse(typeof(AssetBundlePackingType), element.GetAttribute("packingType")); searchPattern = element.GetAttribute("searchPattern"); }