using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RotateControl : MonoBehaviour
{
//float xSpeed = 100f;
//float ySpeed = 100f;
float x = 0f;
float y = 0f;
float Speed = 0.01f;
/// <summary>
/// 第一次按下的位置
/// </summary>
private Vector3 first = Vector3.zero;
/// <summary>
/// 鼠标的拖拽位置(第二次的位置)
/// </summary>
private Vector3 second = Vector3.zero;
/// <summary>
/// 旋转的角度
/// </summary>
//private float angle = 3f;
/// <summary>
/// 记录当前的方向
/// </summary>
public GameObject model;
Vector2 oldPosition1;
Vector2 oldPosition2;
void Update()
{
if (Input.anyKey)
{
//当只有一次触摸
if (Input.touchCount == 1)
{
//触摸类型,滑动
Unity 模型在移动端进行移动、旋转和放大(缩小)
最新推荐文章于 2024-05-16 21:45:02 发布