Skip to content

Commit

Permalink
Update menu item and shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
litefeel committed Jan 2, 2020
1 parent 36d0c7c commit 203fe30
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions Editor/AlignToolsMenu.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
using UnityEditor;
#if UNITY_2019_1_OR_NEWER
using UnityEditor.ShortcutManagement;
using UnityEngine;
#endif


namespace litefeel.AlignTools
{
public static class AlignToolsMenu
{
#if UNITY_2019_1_OR_NEWER
private const string KeyboardMenuPath = "Align Tools/Adjust Position By Keyboard";
private const string WindowMenuPath = "Window/LiteFeel/Align Tools";
#else
private const string KeyboardMenuPath = "Window/LiteFeel/Align Tools/Adjust Position By Keyboard %#K";
private const string WindowMenuPath = "Window/LiteFeel/Align Tools/Align Tools";
#endif

// Creation of window
[MenuItem(WindowMenuPath)]
private static void AlignToolsWindows()
Expand All @@ -24,14 +17,6 @@ private static void AlignToolsWindows()
window.autoRepaintOnSceneChange = true;
}

#if UNITY_2019_1_OR_NEWER
[ClutchShortcut(KeyboardMenuPath, KeyCode.K, ShortcutModifiers.Action | ShortcutModifiers.Shift)]
private static void ToggleKeyboard(ShortcutArguments arg)
{
if (arg.stage == ShortcutStage.Begin)
Settings.AdjustPositionByKeyboard = !Settings.AdjustPositionByKeyboard;
}
#else
[MenuItem(KeyboardMenuPath, true)]
private static bool VaildToggleKeyboard()
{
Expand All @@ -43,7 +28,6 @@ private static void ToggleKeyboard()
{
Settings.AdjustPositionByKeyboard = !Menu.GetChecked(KeyboardMenuPath);
}
#endif
}
}

Expand Down

0 comments on commit 203fe30

Please sign in to comment.