diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f0764b..efb01f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [1.9.4] - 2024-04-18 + +### Added +- Added right-click pings object, but does not select object in history + + ## [1.9.3] - 2024-03-23 ### Fixed diff --git a/Editor/History/Utilities/EditorHistoryGUIUtility.cs b/Editor/History/Utilities/EditorHistoryGUIUtility.cs index 0a6c978..d3a3bca 100644 --- a/Editor/History/Utilities/EditorHistoryGUIUtility.cs +++ b/Editor/History/Utilities/EditorHistoryGUIUtility.cs @@ -10,6 +10,7 @@ namespace Module.NavigationTool.Editor.History public static bool isClicked; public static bool isDoubleClick; + public static bool isRightClick; public static bool isPinClicked; public static EditorHistoryList.Entry currentEntry; public static bool isCurrentEntryPinned; @@ -49,14 +50,16 @@ namespace Module.NavigationTool.Editor.History if (currentEntry == entry) { isClicked = intersects; - + if (isClicked) { + isRightClick = Event.current.button != 0; + if (!isPinClicked) { double dt = EditorApplication.timeSinceStartup - LAST_CLICK_TIME; - - if (dt < 0.3 && CLICK_COUNT == 1 && LAST_CLICK_ENTRY == entry) + + if (!isRightClick && dt < 0.3 && CLICK_COUNT == 1 && LAST_CLICK_ENTRY == entry) CLICK_COUNT++; else CLICK_COUNT = 1; diff --git a/Editor/History/Window/EditorHistoryWindow.cs b/Editor/History/Window/EditorHistoryWindow.cs index 50a1ce3..7c28d7f 100644 --- a/Editor/History/Window/EditorHistoryWindow.cs +++ b/Editor/History/Window/EditorHistoryWindow.cs @@ -77,6 +77,10 @@ namespace Module.NavigationTool.Editor.History { AssetDatabase.OpenAsset(obj); } + else if (EditorHistoryGUIUtility.isRightClick) + { + EditorGUIUtility.PingObject(obj); + } else { EditorHistoryListPostProcess.IgnoreNextSelectionChange(); diff --git a/package.json b/package.json index 39259a9..93cafb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.module.navigationtool", - "version": "1.9.3", + "version": "1.9.4", "displayName": "Module.NavigationTool", "description": "Support for navigation tools, like favorites, history and toolbars", "unity": "2019.2",