var MouseWheelSensitivity = 5;
var MouseZoomMin = 2;
vafloat; r MouseZoomMax = 10;
// 如果按住滑轮
if (Input.GetAxis("Mouse ScrollWheel") != 0)
{
//Debug.Log(Input.GetAxis("Mouse ScrollWheel"));
//Debug.Log(distance);
if (normalDistance >= MouseZoomMin && normalDistance <= mousezoommax)="" {="" normaldistance="" -="Input.GetAxis(" mouse"="" scrollwheel")="" *="" mousewheelsensitivity;="" }="" if="" (normaldistance="">=>< mousezoommin)="" {="" normaldistance="MouseZoomMin;" }="" if="" (normaldistance=""> MouseZoomMax)
{
normalDistance = MouseZoomMax;
}
}normalDistance 肯定有个初始值
可以百jjop度搜:编,程,回,忆,录,之,unity3d,都是从零基础开始讲解的
这个数值主要用于在 MouseZoomMin 与 MouseZoomMax 中运动限制的
即 normalDistance 不能小于 MouseZoomMin 数值,也不能大于 MouseZoomMax 数值
normalDistance 这个数值在鼠标滚轮滑动时不断变化的
normaldistance 肯定有个初始值
这个数值主要用于在 mousezoommin 与 mousezoommax 中运动限制的
即 normaldistance 不能小于 mousezoommin 数值,也不能大于 mousezoommax 数值
normaldistance 这个数值在鼠标滚轮滑动时不断变化的
Photoshop|
Dreamweaver|
SVG|
WebGL|
Visual Studio|
PowerDesigner|
Eclipse|
Git|
Apache Ant|
Atom|
Composer|
CodeSmith|
Flex|
Gradle|
Maven|
Sublime Text3|
SVN|
Tableau|
Vim|
Chrome开发者工具|
OpenGL|
Unity|
Direct3D|
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....