首页 > 其他 > 详细

摄像机位置调节

时间:2015-04-01 23:25:14      阅读:258      评论:0      收藏:0      [点我收藏+]

private var addHeight  = false;
private var minusHeight = false;

 


function LateUpdate () {
    Apply (transform, Vector3.zero);
    distance =( Time.deltaTime*Input.GetAxis("Mouse ScrollWheel")*20 +1)* distance;    
    if (Input.GetKeyDown(KeyCode.PageUp)){
        addHeight = true;
    }
    if (Input.GetKeyUp(KeyCode.PageUp)){
        addHeight = false;
    }        
    if (Input.GetKeyDown(KeyCode.PageDown)){
        minusHeight = true;
    }
    if (Input.GetKeyUp(KeyCode.PageDown)){
        minusHeight = false;
    }
    if (addHeight){
        height = height + Time.deltaTime * 10;
    }
    if (minusHeight && height >=0){
        height = height - Time.deltaTime * 10;        
    }    
}

 

摄像机位置调节

原文:http://www.cnblogs.com/943711466qq/p/4385614.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!