【帅刺猬】用鼠标Wheel中键控制对象的缩放
-
//初始化设置为1.0
-
var size = 1.0;
- //在每一帧的更新中检测鼠标中键动作
-
function Update () {
- //测试一个Cube,找到Cube对象
-
var cube = GameObject.Find("Cube");
- //检测是否有鼠标滚动事件
-
if(Input.GetAxis("Mouse ScrollWheel")){
-
size += Input.GetAxis("Mouse ScrollWheel");
-
cube.transform.localScale=Vector3(1*size,1*size,1*size);
-
}
-
}
You can reach me by surfing the web ---- huntjobs.cn,or sending e-mails to me,Here is my qq MailBox:1424870395@qq.com