跪求U3D 中 用鼠标滚轮 控制镜头的远近
1个回答
展开全部
using UnityEngine;
using System.Collections;
public class CameraControl : MonoBehaviour {
public float speed = 10;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetAxis("Mouse ScrollWheel") != 0)
{
transform.position += Vector3.forward * Input.GetAxis("Mouse ScrollWheel") * speed;
}
}
}
把这个脚本丢到摄像机上面去
using System.Collections;
public class CameraControl : MonoBehaviour {
public float speed = 10;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetAxis("Mouse ScrollWheel") != 0)
{
transform.position += Vector3.forward * Input.GetAxis("Mouse ScrollWheel") * speed;
}
}
}
把这个脚本丢到摄像机上面去
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询