当前位置:网站首页>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;
}
}
}
}
边栏推荐
- Installation de la Bibliothèque de processus PDK - csmc
- Jushan database appears again in the gold fair to jointly build a new era of digital economy
- Sword finger offer II 039 Maximum rectangular area of histogram
- What impact will frequent job hopping have on your career?
- Safe mode on Windows
- 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
- HAC cluster modifying administrator user password
- 应用安全系列之三十七:日志注入
- Detailed summary of SQL injection
- js Array 列表 实战使用总结
猜你喜欢
Easy to understand IIC protocol explanation
Deep learning -yolov5 introduction to actual combat click data set training
03. Login of development blog project
Check the useful photo lossless magnification software on Apple computer
[email protected] raspberry pie"/>
[email protected] raspberry pie
Station B, Master Liu Er - back propagation
Vulhub vulnerability recurrence 71_ Unomi
[Jiudu OJ 08] simple search x
What is independent IP and how about independent IP host?
29io stream, byte output stream continue write line feed
随机推荐
Station B Liu Erden linear regression pytoch
Problems encountered in installing mysql8 on MAC
通讯录管理系统链表实现
01. Project introduction of blog development project
05. Security of blog project
YYGH-11-定时统计
Notes, continuation, escape and other symbols
初识CDN
Game push: image / table /cv/nlp, multi-threaded start!
【云原生】3.1 Kubernetes平台安装KubeSpher
Sequoiadb Lake warehouse integrated distributed database, June 2022 issue
SequoiaDB湖仓一体分布式数据库2022.6月刊
【SQL server速成之路】——身份驗證及建立和管理用戶賬戶
04. Project blog log
Classes and objects (I) detailed explanation of this pointer
Game push image / table /cv/nlp, multi-threaded start
2022 half year summary
自建DNS服务器,客户端打开网页慢,解决办法
应用安全系列之三十七:日志注入
LeetCode_字符串反转_简单_557. 反转字符串中的单词 III