/// <summary> /// OnGUI 후반부에 체크해준다. /// Event가 used가 아니라면 호출 가능 /// </summary> /// <param name=""></param> public HotKeyEvent CheckHotKeyEvent(KeyCode keyCode, bool isShift, bool isAlt, bool isCtrl) { if (!_isAnyEvent) { return(null); } HotKeyEvent hkEvent = null; for (int i = 0; i < _hotKeyEvents.Count; i++) { hkEvent = _hotKeyEvents[i]; if (hkEvent._keyCode == keyCode && hkEvent._isShift == isShift && hkEvent._isAlt == isAlt && hkEvent._isCtrl == isCtrl) { try { //저장된 이벤트를 실행하자 hkEvent._funcEvent(hkEvent._paramObject); return(hkEvent); } catch (Exception ex) { Debug.LogError("HotKey Event Exception : " + ex); return(null); } } } return(null); }
/// <summary> /// OnGUI 후반부에 체크해준다. /// Event가 used가 아니라면 호출 가능 /// </summary> /// <param name=""></param> public HotKeyEvent CheckHotKeyEvent(KeyCode keyCode, bool isShift, bool isAlt, bool isCtrl, bool isPressed) { if (!_isAnyEvent) { return(null); } HotKeyEvent hkEvent = null; for (int i = 0; i < _hotKeyEvents_Live.Count; i++) { hkEvent = _hotKeyEvents_Live[i]; //Pressed 이벤트 = 단일 키 //Released 이벤트 = 조합 키 // 위조건이 안맞으면 continue if ((isPressed && hkEvent._isCombination) || (!isPressed && !hkEvent._isCombination)) { //조합키인데 Pressed 이벤트이거나 //단일키인데 Released 이벤트라면 //패스 continue; } if (hkEvent._keyCode == keyCode && hkEvent._isShift == isShift && hkEvent._isAlt == isAlt && hkEvent._isCtrl == isCtrl) { try { //저장된 이벤트를 실행하자 hkEvent._funcEvent(hkEvent._paramObject); return(hkEvent); } catch (Exception ex) { Debug.LogError("HotKey Event Exception : " + ex); return(null); } } } return(null); }