当前位置:网站首页>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;
}
}
}
}
边栏推荐
- 实践分享:如何安全快速地从 Centos迁移到openEuler
- ArcGIS应用基础4 专题图的制作
- Vulhub vulnerability recurrence 68_ ThinkPHP
- Notes, continuation, escape and other symbols
- 04. Project blog log
- ARTS Week 25
- PDK工藝庫安裝-CSMC
- [Jiudu OJ 07] folding basket
- How to get list length
- 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
猜你喜欢
【SQL server速成之路】——身份验证及建立和管理用户账户

Station B Liu Erden linear regression pytoch
![[JVM] [Chapter 17] [garbage collector]](/img/f4/e6ff0e3edccf23399ec12b7913749a.jpg)
[JVM] [Chapter 17] [garbage collector]

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

剑指 Offer II 039. 直方图最大矩形面积

SequoiaDB湖仓一体分布式数据库2022.6月刊
[SQL Server Express Way] - authentification et création et gestion de comptes utilisateurs

Questions d'examen écrit classiques du pointeur

03. 开发博客项目之登录

嵌入式面试题(四、常见算法)
随机推荐
[cloud native] 3.1 kubernetes platform installation kubespher
(column 22) typical column questions of C language: delete the specified letters in the string.
04. Project blog log
Redis message queue
Pytorch代码注意的细节,容易敲错的地方
Easy to understand IIC protocol explanation
Unity gets the width and height of Sprite
[experience] install Visio on win11
无代码六月大事件|2022无代码探索者大会即将召开;AI增强型无代码工具推出...
Classes and objects (I) detailed explanation of this pointer
嵌入式面试题(一:进程与线程)
Graduation design game mall
[QNX hypervisor 2.2 user manual]6.3.3 using shared memory (shmem) virtual devices
Detailed summary of SQL injection
Yygh-11-timing statistics
Vulhub vulnerability recurrence 72_ uWSGI
05. 博客项目之安全
嵌入式面试题(四、常见算法)
Redis消息队列
进程和线程