(二十)unity4.6學習Ugui中文文檔-------互動-InputModules,ugui-inputmodules
大家好,我是孫廣東。 轉載請註明出處:http://write.blog.csdn.net/postedit/38922399
更全的內容請看我的遊戲蠻牛地址:http://www.unitymanual.com/forum.php?mod=guide&view=my
完整的教程:http://www.unitymanual.com/thread-26665-1-1.html
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如果它是持續的按下
•Process movment
•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
Process 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如果它是持續的按下
•Process 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事件發送到緩衝的拖動處理常式
)
Process scroll wheel events進程滾動滾輪事件
ugui Unity3d什版本才可以用
43的垃圾武器 千萬別換 我換了心疼死了 屬性還沒萬魂好!!!