当前位置:网站首页>Zoom with unity mouse wheel: zoom the camera closer or farther
Zoom with unity mouse wheel: zoom the camera closer or farther
2022-07-06 20:13:00 【LiPing122335】
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class shuBiao : MonoBehaviour {
void Update()
{
// Effect of mouse wheel
if (Input.GetAxis("Mouse ScrollWheel") < 0)
{
if (Camera.main.fieldOfView <= 100)
Camera.main.fieldOfView += 2;
if (Camera.main.orthographicSize <= 20)
Camera.main.orthographicSize += 0.5F;
}
//Zoom in
if (Input.GetAxis("Mouse ScrollWheel") > 0)
{
if (Camera.main.fieldOfView > 2)
Camera.main.fieldOfView -= 2;
if (Camera.main.orthographicSize >= 1)
Camera.main.orthographicSize -= 0.5F;
}
}
}
边栏推荐
- Continuous test (CT) practical experience sharing
- mod_wsgi + pymssql通路SQL Server座
- RT-Thread 组件 FinSH 使用时遇到的问题
- 数据的同步为每个站点创建触发器同步表
- 报错分析~csdn反弹shell报错
- JS get browser system language
- 枚举根据参数获取值
- Crawler (14) - scrape redis distributed crawler (1) | detailed explanation
- Transformer model (pytorch code explanation)
- Node.js: express + MySQL实现注册登录,身份认证
猜你喜欢

Vscode debug run fluent message: there is no extension for debugging yaml. Should we find yaml extensions in the market?

5. 無線體內納米網:十大“可行嗎?”問題

Information System Project Manager - Chapter VIII project quality management

【计网】第三章 数据链路层(4)局域网、以太网、无线局域网、VLAN

Node. Js: express + MySQL realizes registration, login and identity authentication

系统与应用监控的思路和方法

Case ① | host security construction: best practice of 3 levels and 11 capabilities
Tencent T2 Daniel explained in person and doubled his job hopping salary

腾讯字节阿里小米京东大厂Offer拿到手软,老师讲的真棒

BUUCTF---Reverse---easyre
随机推荐
Logstash expressway entrance
Redisson bug analysis
Configuration and simple usage of the EXE backdoor generation tool quasar
How to handle the timeout of golang
Poj3617 best cow line
Enumeration gets values based on parameters
Continuous test (CT) practical experience sharing
AsyncHandler
POJ1149 PIGS 【最大流量】
Case ① | host security construction: best practice of 3 levels and 11 capabilities
永磁同步电机转子位置估算专题 —— 基波模型类位置估算概要
logstash高速入口
腾讯T4架构师,android面试基础
【计网】第三章 数据链路层(4)局域网、以太网、无线局域网、VLAN
Introduction to enterprise lean management system
爬虫(14) - Scrapy-Redis分布式爬虫(1) | 详解
A5000 vGPU显示模式切换
Node. Js: express + MySQL realizes registration, login and identity authentication
Oceanbase Community Edition OBD mode deployment mode stand-alone installation
Tencent cloud database public cloud market ranks top 2!