Event

class in UnityEngine

Description 描述

A UnityGUI event.

UnityGUI的事件。

Events correspond to user input (key presses, mouse actions), or are UnityGUI layout or rendering events.

对应于用户输入事件(按键,鼠标行为),或是UnityGUI布局界面,或渲染事件。

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.

对于每个事件在脚本OnGUI中被调用;OnGUI潜在每帧被多次调用。Event.current对应于在OnGUI里调用当前事件。

See Also: EventType.

Static Variables 静态变量

current The current event that's being processed right now.目前正在处理的事件。

  1. Variables 变量
  2. alt Is Alt/Option key held down? (Read Only)
  3. AltOption键按住了么(只读)?
  4. button Which mouse button was pressed.
  5. 哪个鼠标按键被按下。
  6. capsLock Is Caps Lock on? (Read Only)
  7. Caps Lock键打开了么(只读)?
  8. character The character typed.
  9. 字符类型;就是键盘键入的对应的字符。
  10. clickCount How many consecutive mouse clicks have we received.
  11. 我们收到的鼠标连续点击多少次。
  12. command Is Command/Windows key held down? (Read Only)
  13. Command/Windows键被按住了么(只读)?
  14. commandName The name of an ExecuteCommand or ValidateCommand Event.
  15. ExecuteCommandValidateCommand事件的名字。
  16. control Is Control key held down? (Read Only)
  17. Ctrl键被按住了么(只读)?
  18. delta The relative movement of the mouse compared to last event.
  19. 相对于上次事件,鼠标的相对移动。
  20. displayIndex Index of display that the event belongs to.
  21. 该事件所属的显示器索引。
  22. functionKey Is the current keypress a function key? (Read Only)
  23. 当前按下一个功能键?(只读)
  24. isKey Is this event a keyboard event? (Read Only)
  25. 这个事件是键盘事件么(只读)?
  26. isMouse Is this event a mouse event? (Read Only)
  27. 这个事件是鼠标事件么(只读)?
  28. keyCode The raw key code for keyboard events.
  29. 用于键盘事件的原始键码。
  30. modifiers Which modifier keys are held down.
  31. 哪一个修改键被按住。比如,CtrlAltShift
  32. mousePosition The mouse position.
  33. 鼠标的位置。
  34. numeric Is the current keypress on the numeric keyboard? (Read Only)
  35. 当前按键是数字键么(只读)?
  36. shift Is Shift held down? (Read Only)
  37. Shift键按住了么(只读)?
  38. type The type of event.
  39. 事件的类型。
  1. Public Functions 共有函数
  2. GetTypeForControl Get a filtered event type for a given control ID.
  3. 获取一个给定controlID的事件类型。
  4. Use Use this event.
  5. 使用这个事件。
  1. Static Functions 静态函数
  2. GetEventCount Returns the current number of events that are stored in the event queue.
  3. 返回储存在当前事件队列中的事件数量。
  4. KeyboardEvent Create a keyboard event.
  5. 创建一个键盘事件。
  6. PopEvent Get the next queued [Event] from the event system.
  7. 从事件系统获取下个队列的事件。

?