Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEditor;
- using UnityEngine;
- [InitializeOnLoad]
- public static class SceneViewKeybinds
- {
- static SceneViewKeybinds()
- {
- SceneView.onSceneGUIDelegate += OnSceneGui;
- }
- private static void OnSceneGui(SceneView sceneview)
- {
- DetectBinds();
- }
- private static void DetectBinds()
- {
- if (Event.current != null && Event.current.isKey)
- {
- Debug.Log(Event.current);
- EventModifiers mods = Event.current.modifiers;
- if (Event.current.keyCode == KeyCode.H
- && mods == EventModifiers.Control
- && Event.current.type == EventType.KeyDown)
- {
- Debug.Log("ctrl+H was pressed DOWN in the editor");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement