private void AddDependsAssetBundle(string[] depends) { foreach (string d in depends) { string importerName = ""; string importerValiant = ""; string importerType = ""; var importer = GetAssetBundleNamedDirectoryImporter(d); if (importer != null) { importerType = importer.GetType().Name; importerName = importer.assetBundleName; importerValiant = importer.assetBundleVariant; #if UNITY_5_6_OR_NEWER if (string.IsNullOrEmpty(importerName)) { importerName = AssetDatabase.GetImplicitAssetBundleName(d); importerValiant = AssetDatabase.GetImplicitAssetBundleVariantName(d); } #endif } var assetBundleId = new AssetBundleIdentify(d, importerName, importerValiant, importerType); if (!this.dependBundle.Contains(assetBundleId)) { this.dependBundle.Add(assetBundleId); } } }
private void AddDependsAssetBundle(string[] depends) { foreach (string d in depends) { string importerName = ""; string importerValiant = ""; string importerType = ""; var importer = AssetImporter.GetAtPath(d); if (importer != null) { importerName = importer.assetBundleName; importerValiant = importer.assetBundleVariant; importerType = importer.GetType().Name; } var assetBundleId = new AssetBundleIdentify(d, importerName, importerValiant, importerType); if (!this.dependBundle.Contains(assetBundleId)) { this.dependBundle.Add(assetBundleId); } } }