akadoc/Assets/scripts/CameraController.cs

23 lines
549 B
C#

using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour {
public Vector3 targetPos;
public Quaternion targetRot;
// Use this for initialization
void Awake() {
targetPos = transform.position;
targetRot = transform.rotation;
}
// Update is called once per frame
void Update() {
transform.position = Vector3.Lerp(transform.position, targetPos, Time.deltaTime*10);
transform.rotation = Quaternion.Lerp(transform.rotation, targetRot, Time.deltaTime*10);
}
private GameObject[] cameraPosList;
}