赞
踩
目标与摄像头,摄像头重新出现在两者连线方向的距离目标10m处
Vector3 oldPos = transform.position;
Vector3 dir = oldPos - pos;
Vector3 newPos = pos + dir.normalized * 10;
transform.DOMove(newPos, 0.5f);
实现摄像头lookat 目标效果,并相距10m
Vector3 camRotation = transform.eulerAngles;
Quaternion rotation = Quaternion.Euler(camRotation.x, camRotation.y, 0);
Vector3 negDistance = new Vector3(0.0f, 0.0f, -10);
Vector3 position = rotation * negDistance + pos;
transform.DOMove(position, 0.5f);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。