using System.Collections; using System.Collections.Generic; using UnityEngine; public class TestCamera : MonoBehaviour { public Vector3 offset = Vector3.zero; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if(TestErika.Instance.erika.unitController == null) { return; } Vector3 pos = transform.position; pos.x = TestErika.Instance.erika.unitController.GetComponent().center.x; pos.y = TestErika.Instance.erika.unitController.GetComponent().center.y; transform.position = pos + offset; } }