坦克跟随相机
来源:互联网 发布:筑业标书制作软件 编辑:程序博客网 时间:2024/05/14 23:23
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Camera_Follow_Zoom : MonoBehaviour {
public Transform target;
public float distanceUp = 5f;
public float distanceAway = 5f;
public float smooth = 2f;//位置平滑移动值
public float camDepthSmooth = 2f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update()
{
// 鼠标轴控制相机的远近
if ((Input.mouseScrollDelta.y < 0 && Camera.main.fieldOfView >= 3) || Input.mouseScrollDelta.y > 0 && Camera.main.fieldOfView <= 80)
{
Camera.main.fieldOfView += Input.mouseScrollDelta.y * camDepthSmooth * Time.deltaTime;
}
}
void LateUpdate()
{
//相机的位置
Vector3 disPos = target.position + Vector3.up * distanceUp - target.forward * distanceAway;
transform.position = Vector3.Lerp(transform.position, disPos, Time.deltaTime * smooth);
//相机的角度
transform.LookAt(target.position);
}
}
- 坦克跟随相机
- unity 相机跟随
- Unity平滑相机跟随
- Unity中相机跟随
- uLua实现相机跟随
- Unity3D-相机跟随抖动
- 相机的跟随效果
- 第三人称相机跟随
- Unity3D 相机跟随算法
- 相机第三人称视角跟随
- Unity基础,相机跟随
- unity相机跟随人物移动
- Unity3d相机跟随角色移动
- unity游戏相机跟随效果
- Unity3d学习 相机的跟随
- Unity_相机跟随效果_052
- unity之--相机跟随移动
- OSG 实现跟随节点的相机
- Java学习笔记—对象的比较和集合工具类Collections
- Hadoop 2.6 集群搭建从零开始之2 JDK1.8安装
- 并查集深化---删点操作 {仅记录方法,暂未找到例题}
- hdu-4907-Task schedule
- matlab2c使用c++实现matlab函数系列教程-real函数
- 坦克跟随相机
- 【jdk安装错误】IllegalArgumentException:Invalid characters in hostname
- js弹出放大图
- Java语言基础学习笔记(三)
- web前端性能优化
- 无限轮播
- DexException: Multiple dex files define Lcom/squareup/leakcanary/
- A + B Problem II(大数加法hd1002)
- Android-------多渠道打包