当前位置:网站首页>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;
}
}
}
}
边栏推荐
- [experience] install Visio on win11
- 01. Project introduction of blog development project
- [Jiudu OJ 08] simple search x
- [machine learning notes] univariate linear regression principle, formula and code implementation
- Codeforces Round #804 (Div. 2) Editorial(A-B)
- 【经验】UltralSO制作启动盘时报错:磁盘/映像容量太小
- 无代码六月大事件|2022无代码探索者大会即将召开;AI增强型无代码工具推出...
- Huawei od computer test question 2
- 备忘一下jvxetable的各种数据集获取方法
- 初识CDN
猜你喜欢
02. 开发博客项目之数据存储
03. 开发博客项目之登录
Vulhub vulnerability recurrence 68_ ThinkPHP
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
Yygh-11-timing statistics
Rustdesk builds its own remote desktop relay server
【torch】|torch.nn.utils.clip_grad_norm_
PDK工艺库安装-CSMC
[Jiudu OJ 07] folding basket
Problems encountered in installing mysql8 on MAC
随机推荐
剑指 Offer II 039. 直方图最大矩形面积
Rustdesk builds its own remote desktop relay server
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
[experience] install Visio on win11
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
Application Security Series 37: log injection
What is independent IP and how about independent IP host?
[SQL Server fast track] - authentication and establishment and management of user accounts
The digital economy has broken through the waves. Is Ltd a Web3.0 website with independent rights and interests?
Jvxetable用slot植入j-popup
Solution of QT TCP packet sticking
[email protected] raspberry pie
【经验】win11上安装visio
Station B Liu Erden - linear regression and gradient descent
02. 开发博客项目之数据存储
Sequoiadb Lake warehouse integrated distributed database, June 2022 issue
巨杉数据库再次亮相金交会,共建数字经济新时代
JDBC calls the stored procedure with call and reports an error
SQLite add index
Web Security (V) what is a session? Why do I need a session?