private Vector3 startFingerPos;
private Vector3 nowFingerPos;
private float xMoveDistance;
private float yMoveDistance;
private int backValue = 0;
public GameObject obj;
void Update()
{
if (Input.touchCount <= 0)
{
return;
}
if (Input.GetTouch(0).phase == TouchPhase.Began)
{
//Debug.Log("======开始触摸=====");
startFingerPos = Input.GetTouch(0).position;
}
nowFingerPos = Input.GetTouch(0).position;
if ((Input.GetTouch(0).phase == TouchPhase.Stationary) || (Input.GetTouch(0).phase == TouchPhase.Ended))
{
startFingerPos = nowFingerPos;
//Debug.Log("======释放触摸=====");
return;
}
// if (Input.GetTouch(0).pha