EditorWindow에서 마우스/키보드 입력 체크
EditorWindow에서 Input 클래스는 안먹히는가 보다.
(참조 : http://answers.unity3d.com/questions/15067/input-in-editor-scripts.html)
그래서 대신 사용하는 게 Event 클래스..
Event
A UnityGUI event.
Events correspond to user input (key presses, mouse actions), or are UnityGUI layout or rendering events.
For each event OnGUI is called in the scripts; so OnGUI is potentially called multiple times per frame. Event.current corresponds to "current" event inside OnGUI call.
See Also: GUI Scripting Guide, EventType.
rawType |
|
type | The type of event. |
mousePosition | The mouse position. |
delta | The relative movement of the mouse compared to last event. |
button | Which mouse button was pressed. |
modifiers | Which modifier keys are held down. |
clickCount | How many consecutive mouse clicks have we received. |
character | The character typed. |
commandName | The name of an ExecuteCommand or ValidateCommand Event. |
keyCode | The raw key code for keyboard events. |
shift | Is Shift held down? (Read Only) |
control | Is Control key held down? (Read Only) |
alt | Is Alt/Option key held down? (Read Only) |
command | Is Command/Windows key held down? (Read Only) |
capsLock | Is Caps Lock on? (Read Only) |
numeric | Is the current keypress on the numeric keyboard? (Read Only) |
functionKey | Is the current keypress a function key? (Read Only) |
isKey | Is this event a keyboard event? (Read Only) |
isMouse | Is this event a mouse event? (Read Only) |
GetTypeForControl |
|
Use | Use this event. |
current | The current event that's being processed right now. |
KeyboardEvent | Create a keyboard event. |
링크 : http://docs.unity3d.com/Documentation/ScriptReference/Event.html
'Unity3D > Tips' 카테고리의 다른 글
유니티 소소한 TIP (0) | 2013.04.05 |
---|---|
How to get SceneView Camera? (0) | 2013.03.25 |
비활성화 된 오브젝트 찾을 때.. (0) | 2013.03.21 |
iOS 60프레임으로 셋팅하기 (0) | 2013.03.08 |
씬 로딩화면 (0) | 2013.03.08 |