当前位置:网站首页>Zoom with unity mouse wheel: zoom the camera closer or farther
Zoom with unity mouse wheel: zoom the camera closer or farther
2022-07-06 20:13:00 【LiPing122335】
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class shuBiao : MonoBehaviour {
void Update()
{
// Effect of mouse wheel
if (Input.GetAxis("Mouse ScrollWheel") < 0)
{
if (Camera.main.fieldOfView <= 100)
Camera.main.fieldOfView += 2;
if (Camera.main.orthographicSize <= 20)
Camera.main.orthographicSize += 0.5F;
}
//Zoom in
if (Input.GetAxis("Mouse ScrollWheel") > 0)
{
if (Camera.main.fieldOfView > 2)
Camera.main.fieldOfView -= 2;
if (Camera.main.orthographicSize >= 1)
Camera.main.orthographicSize -= 0.5F;
}
}
}
边栏推荐
- Finally, there is no need to change a line of code! Shardingsphere native driver comes out
- 爬虫(14) - Scrapy-Redis分布式爬虫(1) | 详解
- Poj3617 best cow line
- Linear distance between two points of cesium
- AsyncHandler
- PowerPivot - DAX (first time)
- 永磁同步电机转子位置估算专题 —— 基波模型与转子位置角
- It's enough to read this article to analyze the principle in depth
- 【计网】第三章 数据链路层(4)局域网、以太网、无线局域网、VLAN
- POJ 3207 Ikki&#39;s Story IV – Panda&#39;s Trick (2-SAT)
猜你喜欢

Discussion on beegfs high availability mode

【GET-4】

案例 ①|主机安全建设:3个层级,11大能力的最佳实践

5. Wireless in vivo nano network: top ten "feasible?" problem

Digital triangle model acwing 1018 Minimum toll

22-07-05 upload of qiniu cloud storage pictures and user avatars

5. 無線體內納米網:十大“可行嗎?”問題

报错分析~csdn反弹shell报错

RT thread I2C tutorial
![[network planning] Chapter 3 data link layer (4) LAN, Ethernet, WLAN, VLAN](/img/b8/3d48e185bb6eafcdd49889f0a90657.png)
[network planning] Chapter 3 data link layer (4) LAN, Ethernet, WLAN, VLAN
随机推荐
Oceanbase Community Edition OBD mode deployment mode stand-alone installation
Tencent Android interview must ask, 10 years of Android development experience
Finally, there is no need to change a line of code! Shardingsphere native driver comes out
Tencent architects first, 2022 Android interview written examination summary
Color is converted to tristimulus value (r/g/b) (dry stock)
RT thread I2C tutorial
What happened to the kernel after malloc() was transferred? Attached malloc () and free () implementation source
22-07-05 七牛云存储图片、用户头像上传
mod_wsgi + pymssql通路SQL Server座
Monthly report of speech synthesis (TTS) and speech recognition (ASR) papers in June 2022
Standardized QCI characteristics
[cloud lesson] EI lesson 47 Mrs offline data analysis - processing OBS data through Flink
(3) Web security | penetration testing | basic knowledge of network security construction, IIS website construction, EXE backdoor generation tool quasar, basic use of
爬虫(14) - Scrapy-Redis分布式爬虫(1) | 详解
微信小程序常用集合
JS get browser system language
小微企业难做账?智能代账小工具快用起来
Anaconda安裝後Jupyter launch 沒反應&網頁打開運行沒執行
永磁同步电机转子位置估算专题 —— 基波模型与转子位置角
【Yann LeCun点赞B站UP主使用Minecraft制作的红石神经网络】