当前位置:网站首页>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;
}
}
}
}
边栏推荐
- How to use PHP string query function
- 【SQL server速成之路】——身份验证及建立和管理用户账户
- Vulhub vulnerability recurrence 72_ uWSGI
- [experience] when ultralso makes a startup disk, there is an error: the disk / image capacity is too small
- 网站进行服务器迁移前应做好哪些准备?
- Web Security (V) what is a session? Why do I need a session?
- Rustdesk builds its own remote desktop relay server
- 【torch】|torch. nn. utils. clip_ grad_ norm_
- What impact will frequent job hopping have on your career?
- Deep learning -yolov5 introduction to actual combat click data set training
猜你喜欢
Vulhub vulnerability recurrence 73_ Webmin
Deep learning -yolov5 introduction to actual combat click data set training
SequoiaDB湖仓一体分布式数据库2022.6月刊
Sword finger offer II 039 Maximum rectangular area of histogram
巨杉数据库再次亮相金交会,共建数字经济新时代
Application Security Series 37: log injection
Installation de la Bibliothèque de processus PDK - csmc
B站刘二大人-数据集及数据加载 Lecture 8
【torch】|torch. nn. utils. clip_ grad_ norm_
Vulhub vulnerability recurrence 67_ Supervisor
随机推荐
Summary of deep learning tuning tricks
Installation de la Bibliothèque de processus PDK - csmc
Rustdesk builds its own remote desktop relay server
First knowledge database
After the project is released, index Html is cached
[QNX Hypervisor 2.2用户手册]6.3.3 使用共享内存(shmem)虚拟设备
Self built DNS server, the client opens the web page slowly, the solution
【经验】UltralSO制作启动盘时报错:磁盘/映像容量太小
网站进行服务器迁移前应做好哪些准备?
Yygh-11-timing statistics
Go language -- language constants
Remember an error in MySQL: the user specified as a definer ('mysql.infoschema '@' localhost ') does not exist
Web Security (VI) the use of session and the difference between session and cookie
Pointer classic written test questions
How can large websites choose better virtual machine service providers?
Huawei od computer test question 2
Codeforces Round #804 (Div. 2) Editorial(A-B)
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?
YYGH-11-定时统计