新建一个脚本文件:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class Loading : MonoBehaviour {
public GameObject obj;//3d对象
public Camera userCamera;//3d对象对应的摄像头
private Vector2 tempXY;
private Vector3 currentAngles;
public float moveSpeed = 1;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
//模型自己旋转
// if (aa++ > 100) {
// obj.transform.Rotate (Vector3.up * Time.deltaTime * 200);
// aa = 0;
// }d
if (Input.GetMouseButton(0))//鼠标左键按下滑动
{
tempXY.x -= -Input.GetAxis("Mouse X") * moveSpeed;
tempXY.y += Input.GetAxis("Mouse Y") * moveSpeed;
Vector3 temp = new Vector3(tempXY.x, tempXY.y, obj.transform.positi