akadoc/Assets/scripts/CameraController.cs

23 lines
549 B
C#
Raw Normal View History

2014-10-31 18:02:30 +00:00
using UnityEngine;
using System.Collections;
public class CameraController : MonoBehaviour {
2014-11-01 11:57:46 +00:00
public Vector3 targetPos;
public Quaternion targetRot;
2014-10-31 18:02:30 +00:00
// Use this for initialization
2015-03-04 14:03:15 +00:00
void Awake() {
2014-10-31 18:02:30 +00:00
targetPos = transform.position;
targetRot = transform.rotation;
}
2015-03-04 14:03:15 +00:00
2014-10-31 18:02:30 +00:00
// Update is called once per frame
2015-03-04 14:03:15 +00:00
void Update() {
2014-11-01 11:57:46 +00:00
transform.position = Vector3.Lerp(transform.position, targetPos, Time.deltaTime*10);
transform.rotation = Quaternion.Lerp(transform.rotation, targetRot, Time.deltaTime*10);
2014-10-31 18:02:30 +00:00
}
private GameObject[] cameraPosList;
}