Basic camera movement

This commit is contained in:
2022-10-28 18:26:13 +02:00
parent 28c0221a81
commit 40c8963ec9
116 changed files with 19661 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
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;
mainCamera.orthographicSize = 3f;
}
public void moveCameraBack() {
Debug.Log("Moved back");
mainCamera.transform.position = new Vector3(0, 0, -10);
mainCamera.orthographicSize = 10.3f;
}
}