using UnityEngine;
using System.Collections;
public class RotateAndMove : MonoBehaviour {
private float time;
private bool isRotating=false ;
private Vector3 m_endpos;
public float rotateSpeed=-2;//旋转速度
public float moveSpeed=1;//旋转速度
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.touchCount == 1) {
time+=Time.deltaTime;//当只有一个手指按屏幕时,开始计时
//print ("只有一个手指按屏幕时,开始计时");
if (Input.touches[0].phase==TouchPhase.Ended&&Input.touches[0].phase!=TouchPhase.Canceled){
//canceled的意思是系统取消跟踪触摸,如果用户把屏幕放到他的脸上uop超过五个触摸点时的状态
m_endpos=Input.touches[0].position;
tim
using System.Collections;
public class RotateAndMove : MonoBehaviour {
private float time;
private bool isRotating=false ;
private Vector3 m_endpos;
public float rotateSpeed=-2;//旋转速度
public float moveSpeed=1;//旋转速度
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.touchCount == 1) {
time+=Time.deltaTime;//当只有一个手指按屏幕时,开始计时
//print ("只有一个手指按屏幕时,开始计时");
if (Input.touches[0].phase==TouchPhase.Ended&&Input.touches[0].phase!=TouchPhase.Canceled){
//canceled的意思是系统取消跟踪触摸,如果用户把屏幕放到他的脸上uop超过五个触摸点时的状态
m_endpos=Input.touches[0].position;
tim