using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LiXiaoYaoCtrl : MonoBehaviour
{
/// <summary>
/// 上次触摸的地方
/// </summary>
Touch oldTouch0, oldTouch1;
/// <summary>
/// 旋转速度
/// </summary>
float rotateSpeed = 3.0f;
/// <summary>
/// Update里写缩放
/// </summary>
void Update()
{
//没有触摸
if (Input.touchCount <= 0)
return;
//单手控制旋转
//if (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Moved)
//{
// Vector2 touchDeltaPosition = Input.GetTouch(0).deltaPosition;
// transform.Rotate(0, -touchDeltaPosition.x * rotateSpeed, 0);
//}
//两个触摸点,实现缩放
Touch newTouch0 = Input.GetTouch(0);
Touch newTouch1 = Input.GetTouch(1);
//如果第二个点是刚开始点击,记录两个手指点击的
物体的拖拽,旋转,缩放
最新推荐文章于 2024-04-09 17:59:31 发布
