akadoc/Assets/scripts/Gui_CameraController.cs

27 lines
678 B
C#
Raw Normal View History

2014-10-31 18:02:30 +00:00
using UnityEngine;
using System.Collections;
2015-04-01 19:26:17 +00:00
public class Gui_CameraController : MonoBehaviour {
2014-10-31 18:02:30 +00:00
2014-11-01 11:57:46 +00:00
public Vector3 targetPos;
public Quaternion targetRot;
2015-03-08 08:56:11 +00:00
public Transform initLocation;
2014-11-01 11:57:46 +00:00
2014-10-31 18:02:30 +00:00
// Use this for initialization
2015-03-04 14:03:15 +00:00
void Awake() {
2015-03-08 08:56:11 +00:00
transform.position = initLocation.position;
transform.rotation = initLocation.rotation;
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;
}