Created
April 14, 2024 06:12
-
-
Save baba-s/d6e20b613896653388cdfa93aac5cc9b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if UNITY_EDITOR_OSX | |
#else | |
using UnityEditor; | |
using UnityEditor.ShortcutManagement; | |
using UnityEngine; | |
namespace Kogane.Internal | |
{ | |
/// <summary> | |
/// Mac のようにショートカットキーを使用できるようにするエディタ拡張 | |
/// </summary> | |
internal static class MacLikeShortcutKey | |
{ | |
[Shortcut( "Kogane/Delete", KeyCode.Backspace, ShortcutModifiers.Action )] | |
private static void Delete() | |
{ | |
EditorApplication.ExecuteMenuItem( "Edit/Delete" ); | |
} | |
[Shortcut( "Kogane/Redo", KeyCode.Z, ShortcutModifiers.Action | ShortcutModifiers.Shift )] | |
private static void Redo() | |
{ | |
EditorApplication.ExecuteMenuItem( "Edit/Redo" ); | |
} | |
} | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment