(21) unity4.6 learn Ugui Chinese Document ------- interaction-Supported Events & amp; Raycasters

Source: Internet
Author: User

(21) unity4.6 learn Ugui Chinese Document ------- interaction-Supported Events & amp; Raycasters

 

 

Eventsystem supports a large number of events, and they can be further customized in the InputModules compiled by user-defined users.

 

The interfaces and Implemented interfaces supported by StandaloneInputModule and TouchInputModule can be implemented in MonoBehaviour. If you have a valid EventSystem configuration event, it will be called at the correct time.

 

• 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-called when the pointer enters this object

 

• IPointerExitHandler-OnPointerExit-pointer called when exiting the object

 

• IPointerDownHandler-OnPointerDown-called when the pointer is pressed on the object

 

• Call when the IPointerUpHandler-OnPointerUp-pointer is released (the original status is pressed)

 

• IPointerClickHandler-OnPointerClick-pointer is called when the pointer is pressed and released on the same object (click)

 

• IBeginDragHandler-OnBeginDrag-call when dragging an object

 

• IDragHandler-OnDrag-drag an object, called when the drag is ongoing

 

• IEndDragHandler-OnEndDrag-called when an object is dragged completely

 

• IDropHandler-OnDrop-called when the object is dragged completely

 

• IScrollHandler-OnScroll-called when the scroll wheel of the mouse is rolled

 

• IUpdateSelectedHandler-OnUpdateSelected-called in eachtick on the selected object

 

• ISelectHandler-OnSelect-called when the object becomes the selected object

 

• IDeselectHandler-OnDeselect-called when the selected object becomes unselected

 

• IMoveHandler-OnMove-call When a mobile event occurs (left, right, top, bottom, etc)

 

• ISubmitHandler-OnSubmit-called when the submit button is pressed

 

• ICancelHandler-OnCancel-called when the cancel button is pressed

 

 

 

5.3 Raycasters

 

EventSystem requires a method to detect the number of input events to be sent, which is provided by Raycasters. Raycasters searches for scene and returns the 'most valid' (most effective) object on the given screen location. Several types of Raycasters are provided:

 

• 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-used to search for UI elements on the canvas

 

• Physics2DRaycaster-used for 2D physical elements

 

• PhysicsRaycaster-used for 3D physical elements

 

When Raycaster exists in a scenario and is enabled, it is used for EventSystem to query who sent the InputModule at any time.

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.