u3d 鼠標平移滾輪放大攝像機

//滾輪放大縮小
if (Input.GetAxis("Mouse ScrollWheel") != 0)
{
	transform.Translate(new Vector3(0, 0, Input.GetAxis("Mouse ScrollWheel") * Time.deltaTime * 500));
}
//通過鼠標滾輪按下鍵平移
if (Input.GetMouseButton(2))
{
   transform.Translate(Vector3.left * Input.GetAxis("Mouse X") * move_speed);
	transform.Translate(Vector3.up * Input.GetAxis("Mouse Y") * -move_speed);
}

鏡頭腳本

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章