UnityAPI手册-2019.4官网版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Event
# Event class in UnityEngine ## 描述 UnityGUI 事件。 事件与用户输入(按键、鼠标操作)相对应,或者是 UnityGUI 布局或渲染事件。 对于每个事件,在这些脚本中均调用 [OnGUI](https://docs.unity3d.com/cn/2019.4/ScriptReference/MonoBehaviour.OnGUI.html);因此每帧可能多次调用 OnGUI。 [Event.current](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-current.html) 对应于 OnGUI 调用内的“当前”事件。 另请参阅:[GUI 脚本指南](https://docs.unity3d.com/cn/2019.4/Manual/GUIScriptingGuide.html)、[EventType](https://docs.unity3d.com/cn/2019.4/ScriptReference/EventType.html)。 ## 静态变量 | [current](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-current.html) | 将被立即处理的当前事件。 | | ------------------------------------------------------------------------------- | -------------------------- | ## 变量 | [alt](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-alt.html) | Alt/Option 键是否被按住?(只读) | | ------------------------------------------------------------------------------------------- | -------------------------------------------------- | | [button](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-button.html) | 已按下哪个鼠标键。 | | [capsLock](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-capsLock.html) | 是否打开了 Caps Lock?(只读) | | [character](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-character.html) | 键入的字符。 | | [clickCount](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-clickCount.html) | 已收到了多少次连续鼠标点击。 | | [command](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-command.html) | Command/Windows 键是否被按住?(只读) | | [commandName](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-commandName.html) | ExecuteCommand 或 ValidateCommand 事件的名称。 | | [control](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-control.html) | Control 键是否被按住?(只读) | | [delta](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-delta.html) | 与上次事件相比该鼠标的相对移动。 | | [displayIndex](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-displayIndex.html) | 该事件所属的显示器的索引。 | | [functionKey](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-functionKey.html) | 当前按键是否是功能键?(只读) | | [isKey](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-isKey.html) | 该事件是否是键盘事件?(只读) | | [isMouse](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-isMouse.html) | 该事件是否是鼠标事件?(只读) | | [keyCode](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-keyCode.html) | 键盘事件的原始键代码。 | | [modifiers](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-modifiers.html) | 哪些修改键被按住。 | | [mousePosition](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-mousePosition.html) | 鼠标位置。 | | [numeric](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-numeric.html) | 当前按键是否在数字键盘上?(只读) | | [pointerType](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-pointerType.html) | 创建事件的指针的类型(例如鼠标、触控屏幕、笔)。 | | [pressure](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-pressure.html) | 施加了多大的触笔压力。 | | [shift](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-shift.html) | Shift 键是否被按住?(只读) | | [type](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event-type.html) | 事件的类型。 | ## 公共函数 | [GetTypeForControl](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event.GetTypeForControl.html) | 获取给定控件 ID 的已筛选事件类型。 | | --------------------------------------------------------------------------------------------------- | ------------------------------------ | | [Use](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event.Use.html) | 使用该事件。 | ## 静态函数 | [GetEventCount](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event.GetEventCount.html) | 返回存储在事件队列中的事件的当前数量。 | | ------------------------------------------------------------------------------------------- | ---------------------------------------- | | [KeyboardEvent](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event.KeyboardEvent.html) | 创建键盘事件。 | | [PopEvent](https://docs.unity3d.com/cn/2019.4/ScriptReference/Event.PopEvent.html) | 从事件系统获取排队的下一个 [Event]。 |
da
2022年5月26日 17:53
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码