当前位置:网站首页>unity裏現實攝像頭運鏡並LookAt到物體前方 基於Dotween
unity裏現實攝像頭運鏡並LookAt到物體前方 基於Dotween
2022-06-21 07:34:00 【孤烟冷~】
unity裏現實攝像頭運鏡並LookAt到物體前方 基於Dotween
1.基於Dotween 為了避免使用Update或循環帶來的每幀多餘消耗
2.這裏控制的是主相機到一個物體的運鏡
// plane.transform.GetChild(0)需要到達的物體
//得到倆個點的距離(可以根據倆個物體遠近距離來計算運鏡時間長短)
float lenth = (Camera.main.transform.parent.position - plane.transform.GetChild(0).position).magnitude;
//移動到相應比特置
Camera.main.transform.parent.DOMove(plane.transform.GetChild(0).position + new Vector3(0, 2, 1), Mathf.Clamp(lenth / 1000f, 0.3f, 1.5f));
//LookAt看向相應比特置
Camera.main.transform.parent.DOLookAt(plane.transform.GetChild(0).forward, Mathf.Clamp(lenth / 1000f, 0.3f, 1.5f));
边栏推荐
- How to use MES management system to realize error prevention and early warning
- Pat class B 1031 checking ID card (15 points)
- [OSG] OSG development (03) -- build the osgqt Library of MSVC version
- RDKIT | 基于分子指纹的分子相似性
- Postman发布API文档
- mysql的安装路径如何查看
- C language conditional operator?: The only ternary operator
- Exists and in
- Using XAML only to realize the effect of ground glass background panel
- 23 parameter estimation -- interval estimation of a population parameter
猜你喜欢

In order to thoroughly understand the problem of garbled code, I dug up the history of the character set in a rage

Kubernetes pod的生命周期
![CUDA or FPGA for special purpose 3D graphics computations? [closed]](/img/65/a214d137e230b1a1190feb03660f2c.jpg)
CUDA or FPGA for special purpose 3D graphics computations? [closed]

19 statistics and its sampling distribution -- distribution of sample mean and central limit theorem

EasyExcel-简介-01

ETF operation practice record: February 22, 2022

Wechat applet_ 4. Wxss template style

Google Earth engine (GEE) - Global farmland organic soil carbon and nitrogen emissions (1992-2018) data set

Rdkit | fragment decomposition of drug molecules

C # basic knowledge series 8 (const and readonly keywords)
随机推荐
Arduino about software uninstallation and library uninstallation
Type de contrôle qml: Drawer
Hisilicon series mass production hardware commissioning record
How to make MySQL case insensitive
Dynamic addition of prompt information for successful operation
数学是用于解决问题的工具
Enterprise level development and use POI stepping on pit inventory
[Blue Bridge Cup monolithic unit] serial port communication
How to optimize MySQL paging query
【蓝桥杯单片机组】串口通信
Postman publishing API documentation
19 statistics and its sampling distribution -- distribution of sample mean and central limit theorem
RPA (shadow knife) does not need to write code to capture the product information of an East
Stripping the cocoon -- making the digital control of diversified groups simple
Realize the industry vision of decentralization, safety, accuracy and real-time price feeding
Singleton mode in multithreaded environment
Tensorrt notes (III) reference
模拟手机设备长按事件
CUDA or FPGA for special purpose 3D graphics computations? [closed]
C language conditional operator?: The only ternary operator