18 lines
319 B
C#
18 lines
319 B
C#
|
//The object must have a collider
|
|||
|
|
|||
|
using UnityEngine;
|
|||
|
using System.Collections;
|
|||
|
|
|||
|
public class OnClickedMoveCamera : MonoBehaviour {
|
|||
|
|
|||
|
public Transform destination;
|
|||
|
public CameraController camCtrl;
|
|||
|
|
|||
|
|
|||
|
void OnMouseDown()
|
|||
|
{
|
|||
|
camCtrl.targetPos = destination.position;
|
|||
|
camCtrl.targetRot = destination.rotation;
|
|||
|
}
|
|||
|
}
|