History: Added right-click pings object, but does not select object in history

This commit is contained in:
Anders Ejlersen 2024-04-18 19:22:46 +02:00
parent 1c6f548770
commit 70e110496e
4 changed files with 17 additions and 4 deletions

View file

@ -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

View file

@ -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;

View file

@ -77,6 +77,10 @@ namespace Module.NavigationTool.Editor.History
{
AssetDatabase.OpenAsset(obj);
}
else if (EditorHistoryGUIUtility.isRightClick)
{
EditorGUIUtility.PingObject(obj);
}
else
{
EditorHistoryListPostProcess.IgnoreNextSelectionChange();

View file

@ -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",