void DeleteBundles(object b) { var selectedNodes = b as List <AssetBundleState.BundleInfo.TreeItem>; List <AssetBundleState.BundleInfo> bundles = new List <AssetBundleState.BundleInfo>(); foreach (var n in selectedNodes) { GatherAllBundlesFromNode(n, bundles); } var sb = new System.Text.StringBuilder(); foreach (var r in bundles) { sb.AppendLine(r.m_name); } if (EditorUtility.DisplayDialog("Bundle delete confirmation", "Do you want to delete these bundles:" + Environment.NewLine + sb.ToString(), "Yes", "No")) { AssetBundleState.StartABMoveBatch(); foreach (var r in bundles) { AssetBundleState.RenameBundle(r, string.Empty); } AssetBundleState.EndABMoveBatch(); } }
protected override void RenameEnded(RenameEndedArgs args) { if (args.newName.Length > 0 && args.newName != args.originalName && !AssetBundleState.m_bundles.ContainsKey(args.newName)) { args.acceptedRename = true; AssetBundleState.RenameBundle(Utilities.FindItem <AssetBundleState.BundleInfo.TreeItem>(rootItem, args.itemID).bundle, args.newName); } else { args.acceptedRename = false; } Reload(); }
protected override void RenameEnded(RenameEndedArgs args) { if (args.newName.Length > 0 && args.newName != args.originalName && !AssetBundleState.m_bundles.ContainsKey(args.newName)) { args.acceptedRename = true; var node = Utilities.FindItem <AssetBundleState.BundleInfo.TreeItem>(rootItem, args.itemID); List <AssetBundleState.BundleInfo> bundles = new List <AssetBundleState.BundleInfo>(); GatherAllBundlesFromNode(node, bundles); AssetBundleState.StartABMoveBatch(); foreach (var b in bundles) { AssetBundleState.RenameBundle(b, b.m_name.Replace(args.originalName, args.newName)); } AssetBundleState.EndABMoveBatch(); } else { args.acceptedRename = false; } Reload(); }
void DeleteBundle(object b) { AssetBundleState.RenameBundle(b as AssetBundleState.BundleInfo, string.Empty); }