using UnityEngine;
using System.Collections;
public class Scale : MonoBehaviour {
public float ScaleSpeed = 10.0f;
void Start () {
}
void Update ()
{
//Zoom out
if (Input.GetAxis("Mouse ScrollWheel") <0)
{
Camera.main.transform.Translate(0,0,-1*ScaleSpeed);
}
//Zoom in
if (Input.GetAxis("Mouse ScrollWheel") > 0)
{
Camera.main.transform.Translate(0,0,1*ScaleSpeed);
}
}
}
Unity用鼠标滑轮控制摄像机缩放画面
最新推荐文章于 2024-06-14 18:30:30 发布