当前位置:网站首页>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;
}
}
}
边栏推荐
- Node. Js: express + MySQL realizes registration, login and identity authentication
- Crawler (14) - scrape redis distributed crawler (1) | detailed explanation
- Alibaba data source Druid visual monitoring configuration
- AsyncHandler
- JVM_ Common [interview questions]
- 枚举根据参数获取值
- BUUCTF---Reverse---easyre
- Is it difficult for small and micro enterprises to make accounts? Smart accounting gadget quick to use
- Poj1149 pigs [maximum flow]
- Notes on beagleboneblack
猜你喜欢
Tencent byte Alibaba Xiaomi jd.com offer got a soft hand, and the teacher said it was great
RT thread I2C tutorial
腾讯T2大牛亲自讲解,跳槽薪资翻倍
腾讯字节阿里小米京东大厂Offer拿到手软,老师讲的真棒
Tencent byte and other big companies interview real questions summary, Netease architects in-depth explanation of Android Development
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
语音识别(ASR)论文优选:全球最大的中英混合开源数据TALCS: An Open-Source Mandarin-English Code-Switching Corpus and a Speech
腾讯架构师首发,2022Android面试笔试总结
[cloud native and 5g] micro services support 5g core network
Notes on beagleboneblack
随机推荐
An East SMS login resurrection installation and deployment tutorial
Poj1149 pigs [maximum flow]
Qinglong panel white screen one key repair
String长度限制?
Enumeration gets values based on parameters
22-07-05 upload of qiniu cloud storage pictures and user avatars
【计网】第三章 数据链路层(4)局域网、以太网、无线局域网、VLAN
腾讯安卓开发面试,android开发的基础知识
Tencent architects first, 2022 Android interview written examination summary
Notes on beagleboneblack
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
小微企业难做账?智能代账小工具快用起来
Initial experience of addresssanitizer Technology
Method keywords deprecated, externalprocname, final, forcegenerate
5. Nano - Net in wireless body: Top 10 "is it possible?" Questions
02 基础入门-数据包拓展
腾讯T3手把手教你,真的太香了
2022年6月语音合成(TTS)和语音识别(ASR)论文月报
Node. Js: express + MySQL realizes registration, login and identity authentication
青龙面板白屏一键修复