当前位置:网站首页>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;
}
}
}
边栏推荐
- 腾讯字节等大厂面试真题汇总,网易架构师深入讲解Android开发
- 精彩编码 【进制转换】
- (3) Web security | penetration testing | basic knowledge of network security construction, IIS website construction, EXE backdoor generation tool quasar, basic use of
- 腾讯T3大牛手把手教你,大厂内部资料
- Synchronization of data create trigger synchronization table for each site
- Vscode debug run fluent message: there is no extension for debugging yaml. Should we find yaml extensions in the market?
- beegfs高可用模式探讨
- 青龙面板白屏一键修复
- 22-07-05 upload of qiniu cloud storage pictures and user avatars
- Continuous test (CT) practical experience sharing
猜你喜欢
Special topic of rotor position estimation of permanent magnet synchronous motor -- fundamental wave model and rotor position angle
Notes on beagleboneblack
PowerPivot - DAX (first time)
Anaconda安裝後Jupyter launch 沒反應&網頁打開運行沒執行
rt-thread i2c 使用教程
Node.js: express + MySQL实现注册登录,身份认证
Cesium Click to draw a circle (dynamically draw a circle)
新一代垃圾回收器—ZGC
Microservice architecture debate between radical technologists vs Project conservatives
深度学习分类网络 -- ZFNet
随机推荐
小微企业难做账?智能代账小工具快用起来
5. Nano - Net in wireless body: Top 10 "is it possible?" Questions
语音识别(ASR)论文优选:全球最大的中英混合开源数据TALCS: An Open-Source Mandarin-English Code-Switching Corpus and a Speech
Poj3617 best cow line
beegfs高可用模式探讨
Groovy basic syntax collation
[calculating emotion and thought] floor sweeper, typist, information panic and Oppenheimer
Deep learning classification network -- zfnet
Monthly report of speech synthesis (TTS) and speech recognition (ASR) papers in June 2022
报错分析~csdn反弹shell报错
Anaconda安裝後Jupyter launch 沒反應&網頁打開運行沒執行
Is it difficult for small and micro enterprises to make accounts? Smart accounting gadget quick to use
The "white paper on the panorama of the digital economy" has been released with great emphasis on the digitalization of insurance
BUUCTF---Reverse---easyre
22-07-05 upload of qiniu cloud storage pictures and user avatars
Tencent byte Alibaba Xiaomi jd.com offer got a soft hand, and the teacher said it was great
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
Notes on beagleboneblack
Cesium 点击绘制圆形(动态绘制圆形)
Node. Js: express + MySQL realizes registration, login and identity authentication