(二十一)unity4.6學習Ugui中文文檔-------互動-Supported Events & Raycasters,ugui-supported
大家好,我是孫廣東。 轉載請註明出處: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.2 Supported Events
Eventsystem支援大量的事件,並且他們可以進一步定製在使用者自訂的使用者編寫的 InputModules中。
支援的StandaloneInputModule和 TouchInputModule的事件提供的介面和所實現的介面可以在 MonoBehaviour中實現。如果你有有效 EventSystem配置的事件會在正確的時間被調用。
•IPointerEnterHandler - OnPointerEnter -Called when a pointer enters the object
•IPointerExitHandler - OnPointerExit - Calledwhen a pointer exits the object
•IPointerDownHandler - OnPointerDown - Calledwhen a pointer is pressed on the object
•IPointerUpHandler - OnPointerUp - Calledwhen a pointer is released (called on the original the pressed object)
•IPointerClickHandler - OnPointerClick -Called when a pointer is pressed and released on the same object
•IBeginDragHandler - OnBeginDrag - Called onthe drag object when dragging is about to begin
•IDragHandler - OnDrag - Called on the dragobject when a drag is happening
•IEndDragHandler - OnEndDrag - Called on thedrag object when a drag finishes
•IDropHandler - OnDrop - Called on the objectwhere a drag finishes
•IScrollHandler - OnScroll - Called when amouse wheel scrolls
•IUpdateSelectedHandler - OnUpdateSelected -Called on the selected object each tick
•ISelectHandler - OnSelect - Called when theobject becomes the selected object
•IDeselectHandler - OnDeselect - Called onthe selected object becomes deselected
•IMoveHandler - OnMove - Called when a moveevent occurs (left, right, up, down, ect)
•ISubmitHandler - OnSubmit - Called when thesubmit button is pressed
•ICancelHandler - OnCancel - Called when thecancel button is pressed
•IPointerEnterHandler-OnPointerEnter-當pointer指標進入該對象時調用
•IPointerExitHandler-OnPointerExit- pointer指標退出該對象時調用
•IPointerDownHandler-OnPointerDown-當指標在對象上按下時調用
•IPointerUpHandler-OnPointerUp-pointer指標被釋放(原狀態為被按下)時調用
•IPointerClickHandler-OnPointerClick-pointer指標在同一對象上按下並釋放時調用(單擊)
•IBeginDragHandler-OnBeginDrag-拖動對象在拖動開始時調用
•IDragHandler-OnDrag-拖動對象,當拖動正在發生進行時調用
•IEndDragHandler-OnEndDrag-拖動對象拖動完成時調用
•IDropHandler-OnDrop-對該對象拖動完成時調用
•IScrollHandler-OnScroll-當滑鼠滾輪滾動時調用
•IUpdateSelectedHandler-OnUpdateSelected-在選定的對象上eachtick中調用
•ISelectHandler-OnSelect-當對象成為所選的對象時調用
•IDeselectHandler-OnDeselect-在被選定的對象成為取消被選擇時調用
•IMoveHandler-OnMove-移動事件發生時調用(左、右、上、下等)
•ISubmitHandler-OnSubmit-當按下提交按鈕時調用
•ICancelHandler-OnCancel-當按下取消按鈕時調用
5.3 Raycasters
EventSystem需要一種方法用於檢測當前的輸入的事件需要發送到什麼上,而這由 Raycasters提供的。Raycasters搜尋scene返回給定的螢幕的位置上‘most valid’(最有效)的對象。有幾種類型的 Raycasters被提供:
•GraphicRaycaster - Used for UI elements,lives on a Canvas and searches within the canvas
•Physics2DRaycaster - Used for 2D physicselements
•PhysicsRaycaster - Used for 3D physics elements
•GraphicRaycaster-用於 UI 元素,在畫布上,畫布內搜尋
•Physics2DRaycaster-用於為 2D 物理元素
•PhysicsRaycaster-用於為三維物理元素
當一個情境中存在並且啟用了Raycaster時,它將被用於EventSystem隨時查詢InputModule是誰發出的。
ugui Unity3d什版本才可以用
43的垃圾武器 千萬別換 我換了心疼死了 屬性還沒萬魂好!!!