using UnityEngine;
using System.Collections;
public class CubeStatic : MonoBehaviour
{
public float minFov = 15f;
public float maxFov = 90f;
public float sensitivity = 10f;
void Update()
{
float fov = Camera.main.fieldOfView;
fov += Input.GetAxis("Mouse ScrollWheel") * sensitivity;
fov =
Mathf.Clamp(fov, minFov, maxFov);
Camera.main.fieldOfView = fov;
}
}
原文地址:http://www.cnblogs.com/123ing/p/3769474.html