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

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