using System.Collections; using System.Collections.Generic; using UnityEngine; public class MainCamera : SingletonMB { public new Camera camera { get; private set; } public Vector3 offset = Vector3.zero; protected override void Awake() { base.Awake(); camera = gameObject.GetComponent(); } void Update() { if (TestErika.Instance.erika.unitController == null) { return; } Vector3 pos = transform.position; pos.x = TestErika.Instance.erika.unitController.transform.position.x; pos.y = TestErika.Instance.erika.unitController.transform.position.y; transform.position = pos + offset; } }