当前位置:网站首页>Zoom through the mouse wheel
Zoom through the mouse wheel
2022-07-06 05:43:00 【Python's path to immortality】
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Scroll : MonoBehaviour {
void Update () {
if (Input.GetAxis ("Mouse ScrollWheel")<0)// Move the mouse wheel forward
{
if (Camera .main.fieldOfView <100)// When the camera is a perspective camera , Set a maximum magnification value
{
Camera.main.fieldOfView += 5;// Slide once to move the lens forward 5
}
if (Camera .main.orthographicSize <20)// When the camera is an orthographic camera , Set a maximum magnification value
{
Camera.main.orthographicSize += 0.5f;// Slide once to move the lens forward 0.5
}
}
if (Input .GetAxis ("Mouse ScrollWheel")>0)// Mouse wheel backward stroke
{
if (Camera .main.fieldOfView >5)
{
Camera.main.fieldOfView -= 5;
}
if (Camera .main.orthographicSize>1)
{
Camera.main.orthographicSize -= 0.5f;
}
}
}
}
边栏推荐
- Deep learning -yolov5 introduction to actual combat click data set training
- 改善Jpopup以实现动态控制disable
- Zoom and pan image in Photoshop 2022
- 02. 开发博客项目之数据存储
- Rustdesk builds its own remote desktop relay server
- Summary of deep learning tuning tricks
- Closure, decorator
- AUTOSAR从入门到精通番外篇(十)-嵌入式S19文件解析
- 巨杉数据库再次亮相金交会,共建数字经济新时代
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
猜你喜欢
03. 开发博客项目之登录
Redis message queue
ArcGIS应用基础4 专题图的制作
PDK process library installation -csmc
YYGH-11-定时统计
[Jiudu OJ 08] simple search x
Embedded interview questions (IV. common algorithms)
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
B站刘二大人-线性回归 Pytorch
A master in the field of software architecture -- Reading Notes of the beauty of Architecture
随机推荐
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
RustDesk 搭建一个自己的远程桌面中继服务器
[SQL Server Express Way] - authentification et création et gestion de comptes utilisateurs
ArcGIS application foundation 4 thematic map making
Jushan database appears again in the gold fair to jointly build a new era of digital economy
Summary of deep learning tuning tricks
Algorithm -- climbing stairs (kotlin)
jdbc使用call调用存储过程报错
[JVM] [Chapter 17] [garbage collector]
[cloud native] 3.1 kubernetes platform installation kubespher
Go language -- language constants
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
【华为机试真题详解】统计射击比赛成绩
What is independent IP and how about independent IP host?
Qt TCP 分包粘包的解决方法
C Advanced - data storage (Part 1)
Pointer classic written test questions
【经验】win11上安装visio
[experience] install Visio on win11
Game push image / table /cv/nlp, multi-threaded start