当前位置:网站首页>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;
}
}
}
}
边栏推荐
- Jvxetable用slot植入j-popup
- LeetCode_字符串反转_简单_557. 反转字符串中的单词 III
- Selective parameters in MATLAB functions
- Quantitative description of ANC noise reduction
- Algorithm -- climbing stairs (kotlin)
- Solution of QT TCP packet sticking
- Station B Liu Erden - linear regression and gradient descent
- [detailed explanation of Huawei machine test] check whether there is a digital combination that meets the conditions
- 毕业设计游戏商城
- B站刘二大人-多元逻辑回归 Lecture 7
猜你喜欢

Summary of deep learning tuning tricks

Redis消息队列
![[JVM] [Chapter 17] [garbage collector]](/img/f4/e6ff0e3edccf23399ec12b7913749a.jpg)
[JVM] [Chapter 17] [garbage collector]

实践分享:如何安全快速地从 Centos迁移到openEuler
[email protected]树莓派"/>[email protected]树莓派

Codeless June event 2022 codeless Explorer conference will be held soon; AI enhanced codeless tool launched

应用安全系列之三十七:日志注入
[SQL Server Express Way] - authentification et création et gestion de comptes utilisateurs

ArcGIS application foundation 4 thematic map making

【torch】|torch.nn.utils.clip_grad_norm_
随机推荐
B站刘二大人-线性回归及梯度下降
嵌入式面试题(四、常见算法)
PDK process library installation -csmc
What preparations should be made for website server migration?
初识数据库
【torch】|torch.nn.utils.clip_grad_norm_
Vulhub vulnerability recurrence 73_ Webmin
Game push image / table /cv/nlp, multi-threaded start
【云原生】3.1 Kubernetes平台安装KubeSpher
HAC cluster modifying administrator user password
Analysis of grammar elements in turtle Library
Self built DNS server, the client opens the web page slowly, the solution
After the project is released, index Html is cached
Go language -- language constants
C Advanced - data storage (Part 1)
Pay attention to the details of pytoch code, and it is easy to make mistakes
02. 开发博客项目之数据存储
RustDesk 搭建一个自己的远程桌面中继服务器
[imgui] unity MenuItem shortcut key
[QNX Hypervisor 2.2用户手册]6.3.3 使用共享内存(shmem)虚拟设备