(二十)unity4.6學習Ugui中文文檔-------互動-InputModules,ugui-inputmodules

來源:互聯網
上載者:User

(二十)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的垃圾武器 千萬別換 我換了心疼死了 屬性還沒萬魂好!!!
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.