Unity触摸屏触摸事件定义

    /// <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 @ 2024-06-14 17:32  SummerTrainnn  阅读(5)  评论(0编辑  收藏  举报