纳金网

标题: unity 3D 场景缩放代码 [打印本页]

作者: 王者再临    时间: 2015-2-27 00:45
标题: unity 3D 场景缩放代码

unity 3D 场景缩放代码
  1. using UnityEngine;

  2. using System.Collections;

  3. public class changjingsuofang : MonoBehaviour

  4. {

  5. public float minFov = 15f;

  6. public float maxFov = 90f;

  7. public float sensitivity = 10f;

  8. void Update()

  9. {

  10. float fov = Camera.main.fieldOfView;

  11. fov += Input.GetAxis(“Mouse ScrollWheel”) * sensitivity;

  12. fov = Mathf.Clamp(fov, minFov, maxFov);

  13. Camera.main.fieldOfView = fov;

  14. }

  15. }
复制代码





欢迎光临 纳金网 (http://rs.narkii.com/club/) Powered by Discuz! X2.5