标签:float collect nsf date() 视角 相机 get local oat
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Cam : MonoBehaviour { void Start() { } void Update() { if (Input.GetMouseButton(1)) { float x = Input.GetAxis("Mouse X"); float y = Input.GetAxis("Mouse Y"); transform.Rotate(new Vector3(-y, x)*3); Vector3 v = transform.localEulerAngles; transform.localEulerAngles = new Vector3(v.x,v.y,0); } if (Input.GetMouseButton(0)) { float x = Input.GetAxis("Mouse X"); float y = Input.GetAxis("Mouse Y"); transform.Translate(new Vector3(-x, -y)); } transform.Translate(Vector3.forward*Input.GetAxis("Mouse ScrollWheel")*3); } }
标签:float collect nsf date() 视角 相机 get local oat
原文地址:https://www.cnblogs.com/Feiyuzhu/p/12868985.html