码迷,mamicode.com
首页 > 其他好文 > 详细

UGUI的9个重要回调函数

时间:2016-10-29 22:19:41      阅读:335      评论:0      收藏:0      [点我收藏+]

标签:pointer   cti   blog   hand   engine   end   重要   code   void   

using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;

//句柄
public class ButtonFuc : MonoBehaviour,
IPointerEnterHandler,IPointerExitHandler,//进入,离开
IPointerDownHandler,IPointerUpHandler,//按下抬起
IPointerClickHandler,//点击
IBeginDragHandler,IDragHandler,IEndDragHandler//拖拽
{
    public void OnPointerEnter (PointerEventData eventData)
    {
        Debug.Log ("Enter");
    }

    public void OnPointerExit(PointerEventData eventData)
    {
        Debug.Log ("Exit");
    }

    public void OnPointerDown (PointerEventData eventData)
    {
        Debug.Log ("Down");
    }

    public void OnPointerUp (PointerEventData eventData)
    {
        Debug.Log ("Up");
    }

    public void OnPointerClick (PointerEventData eventData)
    {
        Debug.Log ("Click");
    }

    public void OnBeginDrag (PointerEventData eventData)
    {
        Debug.Log ("BeginDrag");
    }

    public void OnDrag (PointerEventData eventData)
    {
        Debug.Log ("Drag");
    }

    public void OnEndDrag (PointerEventData eventData)
    {
        Debug.Log ("EndDrag");
    }
}

 

UGUI的9个重要回调函数

标签:pointer   cti   blog   hand   engine   end   重要   code   void   

原文地址:http://www.cnblogs.com/VR-1024/p/6011777.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!