Skip to content

Commit e4a3b02

Browse files
committed
feat: Add an option in the ToolbarMenu to record selected objects
1 parent fc5c6af commit e4a3b02

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

Editor/Scripts/AssetQuickAccessWindow.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ private void CreateGUI()
314314
tooltip = "Add External File or Folder",
315315
style = { flexShrink = 0 }
316316
};
317+
toolbarMenu.menu.AppendAction("Add Selected Objects", _ => AddSelectedObjects(),
318+
_ => Selection.objects != null && Selection.objects.Length > 0
319+
? DropdownMenuAction.Status.Normal
320+
: DropdownMenuAction.Status.Disabled);
317321
toolbarMenu.menu.AppendAction("Add External File", AddExternalFile);
318322
toolbarMenu.menu.AppendAction("Add External Folder", AddExternalFolder);
319323
toolbarMenu.menu.AppendAction("Add Menu Item", AddMenuItemEditor);
@@ -514,24 +518,24 @@ private void AddUrlEditor(DropdownMenuAction action)
514518
UrlEditWindow.Open(upperCenter, AddUrl);
515519
}
516520

517-
private void AddMenuItem(string menuPath, string title)
521+
private void AddMenuItem(string menuPath, string menuTitle)
518522
{
519523
if (string.IsNullOrWhiteSpace(menuPath))
520524
{
521525
return;
522526
}
523527

524-
AddItems(null, null, null, new (string menuPath, string title)[] { (menuPath, title) });
528+
AddItems(null, null, null, new (string menuPath, string title)[] { (menuPath, menuTitle) });
525529
}
526530

527-
private void AddUrl(string url, string title)
531+
private void AddUrl(string url, string menuTitle)
528532
{
529533
if (string.IsNullOrWhiteSpace(url))
530534
{
531535
return;
532536
}
533537

534-
AddItems(null, null, new (string url, string title)[] { (url, title) }, null);
538+
AddItems(null, null, new (string url, string title)[] { (url, menuTitle) }, null);
535539
}
536540

537541
#endregion

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Pin frequently used **Unity objects, menu items and external files/folders/urls*
2525

2626
Unity 2021.3 and later.
2727

28-
For Unity 2019.2 - Unity 2021.2, please use version [v1.4.2](https://github.com/SolarianZ/UnityAssetQuickAccessTool/releases/tag/v1.4.2).<br/>
28+
For Unity 2019.2 - Unity 2021.2, please use version [v1.4.3](https://github.com/SolarianZ/UnityAssetQuickAccessTool/releases/tag/v1.4.3).<br/>
2929
For Unity 2017.4 - Unity 2019.1, please use version [v1.2.1](https://github.com/SolarianZ/UnityAssetQuickAccessTool/releases/tag/v1.2.1).
3030

3131
## Installation

README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
Unity 2021.3 或更新版本。
2727

28-
Unity 2019.2 - Unity 2021.2请使用 [v1.4.2](https://github.com/SolarianZ/UnityAssetQuickAccessTool/releases/tag/v1.4.2) 版本。<br/>
28+
Unity 2019.2 - Unity 2021.2请使用 [v1.4.3](https://github.com/SolarianZ/UnityAssetQuickAccessTool/releases/tag/v1.4.3) 版本。<br/>
2929
Unity 2017.4 - Unity 2019.1请使用 [v1.2.1](https://github.com/SolarianZ/UnityAssetQuickAccessTool/releases/tag/v1.2.1) 版本。
3030

3131
## 安装

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.greenbamboogames.assetquickaccess",
3-
"version": "3.3.2",
3+
"version": "3.3.3",
44
"displayName": "Asset Quick Access!",
55
"description": "Pin frequently used objects to a separate editor window. An enhanced version of Unity's Favorites feature.",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)