当前位置:网站首页>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;
}
}
}
}
边栏推荐
- Zoom and pan image in Photoshop 2022
- Pay attention to the details of pytoch code, and it is easy to make mistakes
- Codeless June event 2022 codeless Explorer conference will be held soon; AI enhanced codeless tool launched
- B站刘二大人-数据集及数据加载 Lecture 8
- Redis消息队列
- 28io stream, byte output stream writes multiple bytes
- 无代码六月大事件|2022无代码探索者大会即将召开;AI增强型无代码工具推出...
- How to get list length
- Questions d'examen écrit classiques du pointeur
- jdbc使用call调用存储过程报错
猜你喜欢

Redis message queue

What is independent IP and how about independent IP host?

Codeforces Round #804 (Div. 2) Editorial(A-B)

Notes, continuation, escape and other symbols

PDK process library installation -csmc
![[experience] install Visio on win11](/img/f5/42bd597340d0aed9bfd13620bb0885.png)
[experience] install Visio on win11

01. Project introduction of blog development project

Promise summary

26file filter anonymous inner class and lambda optimization

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
随机推荐
Qt TCP 分包粘包的解决方法
数字经济破浪而来 ,LTD是权益独立的Web3.0网站?
应用安全系列之三十七:日志注入
[force buckle]43 String multiplication
After the project is released, index Html is cached
【华为机试真题详解】检查是否存在满足条件的数字组合
UCF (2022 summer team competition I)
无代码六月大事件|2022无代码探索者大会即将召开;AI增强型无代码工具推出...
How to get list length
剑指 Offer II 039. 直方图最大矩形面积
[Tang Laoshi] C -- encapsulation: classes and objects
PDK工艺库安装-CSMC
B站刘二大人-多元逻辑回归 Lecture 7
Garbage collector with serial, throughput priority and response time priority
[email protected] raspberry pie
JDBC calls the stored procedure with call and reports an error
ArcGIS application foundation 4 thematic map making
C进阶-数据的存储(上)
[Jiudu OJ 08] simple search x
RustDesk 搭建一个自己的远程桌面中继服务器