纳金网
标题:
unity 3D 场景缩放代码
[打印本页]
作者:
王者再临
时间:
2015-2-27 00:45
标题:
unity 3D 场景缩放代码
unity 3D 场景缩放代码
using UnityEngine;
using System.Collections;
public class changjingsuofang : 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://rs.narkii.com/club/)
Powered by Discuz! X2.5