当前位置:网站首页>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;
}
}
}
}
边栏推荐
- 嵌入式面试题(四、常见算法)
- 什么是独立IP,独立IP主机怎么样?
- 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
- 59. Spiral matrix
- What is independent IP and how about independent IP host?
- 【云原生】3.1 Kubernetes平台安装KubeSpher
- How to download GB files from Google cloud hard disk
- Processes and threads
- ARTS Week 25
- [force buckle]43 String multiplication
猜你喜欢

初识CDN
![[Tang Laoshi] C -- encapsulation: classes and objects](/img/4e/30d2d4652ea2d4cd5fa7cbbb795863.jpg)
[Tang Laoshi] C -- encapsulation: classes and objects

Redis message queue

B站刘二大人-反向传播

Station B Liu Erden - linear regression and gradient descent

The digital economy has broken through the waves. Is Ltd a Web3.0 website with independent rights and interests?

05. 博客项目之安全
![[Jiudu OJ 07] folding basket](/img/a7/e394f32cf7f02468988addad67674b.jpg)
[Jiudu OJ 07] folding basket

27io stream, byte output stream, OutputStream writes data to file

Self built DNS server, the client opens the web page slowly, the solution
随机推荐
Unity gets the width and height of Sprite
【SQL server速成之路】——身份验证及建立和管理用户账户
Jushan database appears again in the gold fair to jointly build a new era of digital economy
Jvxetable用slot植入j-popup
[JVM] [Chapter 17] [garbage collector]
29io stream, byte output stream continue write line feed
[email protected]树莓派
Quantitative description of ANC noise reduction
UCF (summer team competition II)
Redis消息队列
Embedded interview questions (IV. common algorithms)
Pytorch代码注意的细节,容易敲错的地方
PDK process library installation -csmc
Detailed summary of SQL injection
Auto.js学习笔记17:基础监听事件和UI简单的点击事件操作
Promotion hung up! The leader said it wasn't my poor skills
Go language -- language constants
【经验】UltralSO制作启动盘时报错:磁盘/映像容量太小
Station B Liu Erden softmx classifier and MNIST implementation -structure 9
Pay attention to the details of pytoch code, and it is easy to make mistakes