Files
findthesource/Assets/Scripts/CameraMovement.cs

23 lines
599 B
C#
Raw Normal View History

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-07 17:25:24 +01:00
mainCamera.transform.position = new Vector3((float)-2.15, 0, -10);
2022-10-28 18:26:13 +02:00
mainCamera.orthographicSize = 10.3f;
}
}