History: Added right-click pings object, but does not select object in history
This commit is contained in:
parent
1c6f548770
commit
70e110496e
|
|
@ -2,6 +2,12 @@
|
||||||
All notable changes to this project will be documented in this file.
|
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
|
## [1.9.3] - 2024-03-23
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ namespace Module.NavigationTool.Editor.History
|
||||||
|
|
||||||
public static bool isClicked;
|
public static bool isClicked;
|
||||||
public static bool isDoubleClick;
|
public static bool isDoubleClick;
|
||||||
|
public static bool isRightClick;
|
||||||
public static bool isPinClicked;
|
public static bool isPinClicked;
|
||||||
public static EditorHistoryList.Entry currentEntry;
|
public static EditorHistoryList.Entry currentEntry;
|
||||||
public static bool isCurrentEntryPinned;
|
public static bool isCurrentEntryPinned;
|
||||||
|
|
@ -52,11 +53,13 @@ namespace Module.NavigationTool.Editor.History
|
||||||
|
|
||||||
if (isClicked)
|
if (isClicked)
|
||||||
{
|
{
|
||||||
|
isRightClick = Event.current.button != 0;
|
||||||
|
|
||||||
if (!isPinClicked)
|
if (!isPinClicked)
|
||||||
{
|
{
|
||||||
double dt = EditorApplication.timeSinceStartup - LAST_CLICK_TIME;
|
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++;
|
CLICK_COUNT++;
|
||||||
else
|
else
|
||||||
CLICK_COUNT = 1;
|
CLICK_COUNT = 1;
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,10 @@ namespace Module.NavigationTool.Editor.History
|
||||||
{
|
{
|
||||||
AssetDatabase.OpenAsset(obj);
|
AssetDatabase.OpenAsset(obj);
|
||||||
}
|
}
|
||||||
|
else if (EditorHistoryGUIUtility.isRightClick)
|
||||||
|
{
|
||||||
|
EditorGUIUtility.PingObject(obj);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EditorHistoryListPostProcess.IgnoreNextSelectionChange();
|
EditorHistoryListPostProcess.IgnoreNextSelectionChange();
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "com.module.navigationtool",
|
"name": "com.module.navigationtool",
|
||||||
"version": "1.9.3",
|
"version": "1.9.4",
|
||||||
"displayName": "Module.NavigationTool",
|
"displayName": "Module.NavigationTool",
|
||||||
"description": "Support for navigation tools, like favorites, history and toolbars",
|
"description": "Support for navigation tools, like favorites, history and toolbars",
|
||||||
"unity": "2019.2",
|
"unity": "2019.2",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue