纳金网

标题: 想請教限制旋轉角度和移動範圍的方法? [打印本页]

作者: 她。    时间: 2013-2-1 14:07
标题: 想請教限制旋轉角度和移動範圍的方法?
想請教限制旋轉角度和移動範圍的方法?希望各位高手大大幫忙解答 我用的語法是var speed=20;function Update () {
if(Input.GetAxis("Horizontal"))
{
transform.Rotate(Input.GetAxis("Horizontal")*Time.deltaTime*speed,0,0);
}
}我該加入甚麼語法才可以限制它轉動的角度呢?
作者: Zack    时间: 2013-2-2 00:40
参考官方脚本里面的 MouseOrbit.js试试。
var __chd__ = {'aid':11079,'chaid':'www_objectify_ca'};(function() { var c = document.createElement('script'); c.type = 'text/javascript'; c.async = ***e;c.src = ( 'https:' == document.location.protocol ? 'https://z': 'http://p') + '.chango.com/static/c.js'; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(c, s);})();




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