Unity触摸屏触摸事件定义

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/// <summary>
/// 更新触摸事件
/// </summary>
private void UpdateTouchEvent()
{
    if (Input.touchCount>0)
    {
        if (Input.GetTouch(0).phase== TouchPhase.Began)
        {
            //Input.mousePosition = Input.GetTouch(0).position;
 
        }
        else if (Input.GetTouch(0).phase == TouchPhase.Moved)
        {
 
        }
        else if(Input.GetTouch(0).phase == TouchPhase.Ended)
        {
 
        }
    }
}

  

posted @   SummerTrainnn  阅读(10)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示