2022-10-28 18:26:13 +02:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class CameraMovement : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public Camera mainCamera;
|
|
|
|
|
public Vector3 offset;
|
|
|
|
|
|
|
|
|
|
public void moveCameraToTarget(Transform target) {
|
|
|
|
|
Debug.Log("Moved to " + target.name);
|
|
|
|
|
mainCamera.transform.position = target.position + offset;
|
2022-10-30 15:02:17 +01:00
|
|
|
mainCamera.orthographicSize = 3.5f;
|
2022-10-28 18:26:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void moveCameraBack() {
|
|
|
|
|
Debug.Log("Moved back");
|
2022-11-12 12:18:08 +01:00
|
|
|
mainCamera.transform.position = new Vector3((float)-4, 0, -10);
|
|
|
|
|
mainCamera.orthographicSize = 11f;
|
2022-10-28 18:26:13 +02:00
|
|
|
}
|
|
|
|
|
}
|