Как реализовано передвижение камеры по координатам?
Не помню уже, но примерно так:
public IEnumerator MoveCam(Transform fromPoint, Transform toPoint, float transTime){ var timer = 0f; while(timer <= transTime) { yield return null; var tempTime = timer / transTime; var camTrans = Camera.AllCameras[0].transform; camTrans.position = Vector3.Lerp(fromPoint.position, toPoint.position, tempTime); camTrans.rotation = Quaternion.Lerp(fromPoint.rotation, toPoint.rotation, tempTime); timer += Time.deltaTime; }}
Как реализовано передвижение камеры по координатам?
Не помню уже, но примерно так:
public IEnumerator MoveCam(Transform fromPoint, Transform toPoint, float transTime)
{
var timer = 0f;
while(timer <= transTime)
{
yield return null;
var tempTime = timer / transTime;
var camTrans = Camera.AllCameras[0].transform;
camTrans.position = Vector3.Lerp(fromPoint.position, toPoint.position, tempTime);
camTrans.rotation = Quaternion.Lerp(fromPoint.rotation, toPoint.rotation, tempTime);
timer += Time.deltaTime;
}
}