这次文章主要是看了网上写的很多关于物体上下左右位移,鼠标控制物体的大小,旋转问题,但是下载很多,依然没有自己想要的结果,就自己根据前辈经验,在上面稍加修改,简直就是班门弄斧了。方便自己,也方便大家.这次主要有几点需要说明,就是里面的GameObject需要我们自己去拖,毕竟unity大家为了方便使用,所有能设置为变量的都需要设置变量,一目了然。有点unity基础的都能够看的懂。我上面加的有一个iTween,我作为跳转场景使用了我直接注释掉,也不删除了,看看也可以。
using UnityEngine;
using System.Collections;
using System.IO;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class Move : MonoBehaviour
{
public Transform target;
private int MouseWheelSensitivity = 50;
private int MouseZoomMin = 20;
private int MouseZoomMax = 112;
private float normalDistance = 500;
private Vector3 normalized;
private float xSpeed = 250.0f;
private float ySpeed = 120.0f;
private float x = 0.0f;
private float y = 0.0f;
private System.DateTime oldTime;
private System.DateTime