- 最后登录
- 2016-8-29
- 注册时间
- 2012-8-25
- 阅读权限
- 90
- 积分
- 23585
- 纳金币
- 20645
- 精华
- 62
|
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;
-
- }
-
- }
复制代码 |
|