ThirdPersonCamera
来源:互联网 发布:淘宝网苏泊尔砂锅内胆 编辑:程序博客网 时间:2024/05/17 22:28
using UnityEngine;
using System.Collections;
public class ThirdPersonCamera : MonoBehaviour
{
public float distanceAway;
public float distanceUp;
public float smooth;
private Vector3 targetPosition;
Transform follow;
void Start(){
follow = GameObject.FindWithTag ("Player").transform;
}
void LateUpdate ()
{
targetPosition = follow.position + Vector3.up * distanceUp - follow.forward * distanceAway;
transform.position = Vector3.Lerp(transform.position, targetPosition, Time.deltaTime * smooth);
transform.LookAt(follow);
}
}
using System.Collections;
public class ThirdPersonCamera : MonoBehaviour
{
public float distanceAway;
public float distanceUp;
public float smooth;
private Vector3 targetPosition;
Transform follow;
void Start(){
follow = GameObject.FindWithTag ("Player").transform;
}
void LateUpdate ()
{
targetPosition = follow.position + Vector3.up * distanceUp - follow.forward * distanceAway;
transform.position = Vector3.Lerp(transform.position, targetPosition, Time.deltaTime * smooth);
transform.LookAt(follow);
}
}
0 0
- ThirdPersonCamera
- unity自带脚本ThirdPersonCamera.cs(收藏)
- 【C】可变参数列表剖析
- 升级WEXT到NL80211/CFG80211
- Android Studio创建签名文件 New Key Store.
- ckeditor上传图片后取的内容存在style样式解决方案
- Digit Recognizer by LightGBM
- ThirdPersonCamera
- 八数码(POJ-1077或HDU-1043)
- Trafodion 全局设置UTF8格式
- ReLu(Rectified Linear Units)激活函数
- 如何防止iOS网页中的数字被识别为电话号码
- PAT:L2-014. 列车调度
- C++ Boost在Windows和Linux下的编译安装
- SpringMVC 使用JSR-303进行校验[转自-自行车上的程序员]
- Problem A: 编写函数:三个数的最大最小值 (Append Code)