请选择 进入手机版 | 继续访问电脑版

【3D技术宅公社】XR数字艺术论坛  XR技术讨论 XR互动电影 定格动画

 找回密码
 立即注册

QQ登录

只需一步,快速开始

调查问卷
论坛即将给大家带来全新的技术服务,面向三围图形学、游戏、动画的全新服务论坛升级为UTF8版本后,中文用户名和用户密码中有中文的都无法登陆,请发邮件到324007255(at)QQ.com联系手动修改密码

3D技术论坛将以计算机图形学为核心,面向教育 推出国内的三维教育引擎该项目在持续研发当中,感谢大家的关注。

查看: 2597|回复: 0

[官方GUI] (二十)unity4.6学习Ugui中文文档-------交互-InputModules

[复制链接]
发表于 2015-4-25 12:06:27 | 显示全部楼层 |阅读模式
5.1 InputModules


输入的模块是在哪里配置和定制事件系统的主要逻辑。有两个InputModules被提供,一个设计为Standalone独立的和一个用于Touch触摸屏输入。每个模块接收和发送事件,正如你期望在给定的配置。


如果你想要自定义的事件处理在您的应用程序中,可以编写自定义 InputModules。


5.1.1 Touch Input Module


input module被设计为使用触摸的基础设备上。这可处理的输入并发送事件会在触摸设备上预期的那样。


该模块的流程如下所示:


♥For each touch event关于每个触摸事件


♦If it is a new press如果它是新的按下


•Send PointerEnter event (sent to everyobject up the hierarchy that can handle it)


•Send PointerPress event


•Cache the drag handler (first element in the hierarchy that canhandle it)


•Send BeginDrag event to the drag handler


•Set the ‘Pressed’ object as Selected in the event system



发送 PointerEnter事件(发送到每个对象可以在hierarchy中处理)


发送 PointerPress事件


缓存的拖动处理程序(在hierarchy中,可以处理它的第一个元素)


BeginDrag事件发送到拖动处理程序


在event system中设置‘Pressed’ 对象为Selected



♦If this is a continuing press如果它是持续的按下


[url=]&#8226rocess movment[/url]


•Send DragEvent to the cached drag handler


•Handle PointerEnter and PointerExit events if touch moves betweenobjects



处理移动


发送DragEvent到缓存的拖动处理程序


如果对象之间触摸移动,处理 PointerEnter和 PointerExit的事件



♦If this is a release如果它是释放按下


•Send PointerUp event to the object that received the PointerPress


•If the current hover object is the same as the PointerPress objectsend a PointerClick event


•Send a Drop event if there was a drag handler cached


•Send a EndDrag event to teh cached drag handler



发送PointerUp事件到接受PointerPress的对象


如果当前悬停对象是相同的 PointerPress对象发送一个 PointerClick事件


如果拖动处理程序被缓存,发送Drop事件


EndDrag事件发送到缓存的拖动处理程序


5.1.2 Standalone Input Module


input module用于鼠标、键盘和控制器。该模块被配置查看 InputManager,发送事件是基于输入Input manager管理器是何种状态。


本模块使用:


♥Vertical / Horizontal axis for keyboard and controller navigation


♥Submit / Cancel button for sending submit and cancel events


♥Has a timeout between events to only allow a maximum number of events a second.



垂直 /水平轴,用于键盘和控制器的导航


提交 /取消按钮发送提交和取消事件


仅允许最大每秒事件数之间。



该模块的流程如下所示:


♥Send a Move event to the selected object if a valid axis from the input manager is entered


♥Send a submit or cancel event to the selected object if a submit or cancel button is pressed


&#9829rocess Mouse input



如果从input manager中输入了有效的轴,将发送Move移动事件发送到选定的对象上


如果按下一个提交或取消按钮,发送一个提交或取消事件到所选对象上


处理鼠标输入



♦If it is a new press 如果它是新的按下


•Send PointerEnter event (sent to every object up the hierarchy that can handle it)


•Send PointerPress event


•Cache the drag handler (first element in the hierarchy that can handle it)


•Send BeginDrag event to the drag handler


•Set the ‘Pressed’ object as Selected in the event system




发送 PointerEnter事件(发送到每个对象可以在hierarchy中处理)


发送 PointerPress事件


缓存的拖动处理程序(在hierarchy中,可以处理它的第一个元素)


BeginDrag事件发送到拖动处理程序


在event system中设置‘Pressed’ 对象为Selected



♦If this is a continuing press如果它是持续的按下


&#8226rocess movment


•Send DragEvent to the cached drag handler


•Handle PointerEnter and PointerExit events if touch moves between objects




处理移动


发送DragEvent到缓存的拖动处理程序


如果对象之间触摸移动,处理 PointerEnter和 PointerExit的事件



♦If this is a release如果它是释放按下


•Send PointerUp event to the object that received the PointerPress


•If the current hover object is the same as the PointerPress object send a PointerClick event


•Send a Drop event if there was a drag handler cached


•Send a EndDrag event to teh cached drag handler




发送PointerUp事件到接受PointerPress的对象


如果当前悬停对象是相同的 PointerPress对象发送一个 PointerClick事件


如果拖动处理程序被缓存,发送Drop事件


EndDrag事件发送到缓存的拖动处理程序



&#9829rocess scroll wheel events进程滚动滚轮事件




您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|3D数字艺术论坛 ( 沪ICP备14023054号 )

GMT+8, 2024-3-28 20:05

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表