zoukankan      html  css  js  c++  java
  • (二十一)unity4.6学习Ugui中文文档-------交互-Supported Events & Raycasters

    大家好,我是孙广东。

      转载请注明出处: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-当按下提交button时调用


    ICancelHandler-OnCancel-当按下取消button时调用


     


    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是谁发出的。


     


  • 相关阅读:
    Spring中Bean及@Bean的理解
    Visual Studio(VS)秘钥集合
    PLC不能初始化问题
    【原创】C# API 未能创建 SSL/TLS 安全通道 问题解决
    【原创】XAF CriteriaOperator 使用方式汇总
    【原创】.Net WebForm Calendar 日历控件常用方法
    【原创】XAF常用属性字段设置
    【记录】Windows 操作系统常用快捷命令
    【XAF】常见错误以及对应解决方法
    【原创】XAF ITreeNode+NonPersistent 使用方式
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/5147692.html
Copyright © 2011-2022 走看看