Skip to content

Commit ca07acc

Browse files
committed
feat: remove tailing / and \ when finding object by path
1 parent d3f5ca8 commit ca07acc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Editor/Scripts/AssetQuickAccessWindow.BottomContent.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ private void FindObjectByPathOrGuid()
5858
if (string.IsNullOrEmpty(filePath))
5959
{
6060
filePath = _assetIdentifier;
61+
if (_assetIdentifier.EndsWith("/") || _assetIdentifier.EndsWith("\\"))
62+
{
63+
filePath = _assetIdentifier.Remove(_assetIdentifier.Length - 1);
64+
if (string.IsNullOrEmpty(filePath))
65+
{
66+
ShowNotification(new GUIContent($"Can not find asset with guid or path:\n{_assetIdentifier}"));
67+
return;
68+
}
69+
}
6170
}
6271

6372
UObject asset = AssetDatabase.LoadAssetAtPath<UObject>(filePath);

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": "1.3.3",
3+
"version": "1.3.4",
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": "2019.4",

0 commit comments

Comments
 (0)