(十九)unity4.6學習Ugui中文文檔-------互動-EventSystem,ugui-eventsystem

來源:互聯網
上載者:User

(十九)unity4.6學習Ugui中文文檔-------互動-EventSystem,ugui-eventsystem

大家好,我是孫廣東。   轉載請註明出處:http://write.blog.csdn.net/postedit/38922399

更全的內容請看我的遊戲蠻牛地址:http://www.unitymanual.com/forum.php?mod=guide&view=my


5、EventSystem


EventSystem是一種將基於輸入的事件發送到應用程式中的對象,無論是鍵盤、滑鼠、觸摸或自訂輸入。EventSystem由發送事件的幾個組件共同組成。


Overview


當您將 EventSystem組件添加到一個遊戲對象上,你會發現它並沒有多少暴露的功能時,這是因為 EventSystem本身被設計為一個manager and facilitator(管理和主持)EventSystem模組之間的通訊。


EventSystem的主要作用是,如下所示:


•Manage which GameObject is consideredselected


•Manage which InputModule is in use


•Manage Raycasting (if required)


•Updating all InputModules as required


•管理被選中遊戲對象


•管理正在使用的InputModule


•管理Raycasting(如果需要)


•更新所需的所有 InputModules


 


Input Modules


輸入的模組是EventSystem表現的主要邏輯怎樣的,它們用於:


•Handling Input


•Managing event state


•Sending events to scene objects.


•處理輸入


•管理事件的狀態


•將事件發送到情境物體。


在同一時間只有一個 InputModule可以在 EventSystem 中處於活動狀態,並且他們必須作為 EventSystem組件的同一遊戲物體上的組件。


 


Raycasters


Raycasters用於發送確定pointer指標位於什麼上方,對於InputModules使用Raycasters這是常見的,情境配置中用於計算pointing裝置是over。


有 3種情況提供的Raycasters預設存在:


•GraphicRaycaster - Used for UI elements


•2DPhysicsRaycaster - Used for 2D physicselements


•3DPhysicsRaycaster- Used for 3D physics elements


•GraphicRaycaster-用於 UI元素


•2DPhysicsRaycaster-用於為 2D物理元素


•3DPhysicsRaycaster-用於為三維物理元素







聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.