当前位置:网站首页>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;
}
}
}
}
边栏推荐
- 清除浮动的方式
- Clear floating mode
- First acquaintance with CDN
- After the project is released, index Html is cached
- Pay attention to the details of pytoch code, and it is easy to make mistakes
- 网站进行服务器迁移前应做好哪些准备?
- 03. Login of development blog project
- 01. Project introduction of blog development project
- Jvxetable用slot植入j-popup
- Web Security (VI) the use of session and the difference between session and cookie
猜你喜欢

Vulhub vulnerability recurrence 69_ Tiki Wiki
![[Jiudu OJ 08] simple search x](/img/a7/12a00c5d1db2deb064ff5f2e83dc58.jpg)
[Jiudu OJ 08] simple search x

How to download GB files from Google cloud hard disk

05. 博客项目之安全

Redis消息队列

What is independent IP and how about independent IP host?

Easy to understand IIC protocol explanation

Download, install and use NVM of node, and related use of node and NRM

Yygh-11-timing statistics

Migrate Infones to stm32
随机推荐
[machine learning notes] univariate linear regression principle, formula and code implementation
First acquaintance with CDN
Easy to understand IIC protocol explanation
类和对象(一)this指针详解
[SQL Server Express Way] - authentification et création et gestion de comptes utilisateurs
Go language -- language constants
改善Jpopup以实现动态控制disable
Selective parameters in MATLAB functions
The digital economy has broken through the waves. Is Ltd a Web3.0 website with independent rights and interests?
HAC cluster modifying administrator user password
02. 开发博客项目之数据存储
Jvxetable用slot植入j-popup
Station B Liu Erden - linear regression and gradient descent
Codeforces Round #804 (Div. 2) Editorial(A-B)
Station B, Master Liu Er - back propagation
SQLite add index
Installation de la Bibliothèque de processus PDK - csmc
Web Security (VI) the use of session and the difference between session and cookie
Sword finger offer II 039 Maximum rectangular area of histogram
备忘一下jvxetable的各种数据集获取方法