原文链接:http://blog.csdn.net/u013108312/article/details/52575750
新建一个Cube,添加脚本:TestInput.cs
using UnityEngine;
using System.Collections;
public class TestInput : MonoBehaviour {
public float speed = 0.1F;
void Update()
{
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved)
{
Vector2 touchDeltaPosition = Input.GetTouch(0).deltaPosition;
transform.Translate(touchDeltaPosition.x * speed,0f, touchDeltaPosition.y * speed);
}
}
}