From a9d460f503f4d09a4c0e00164c6ca1ba3f8725dd Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 11 Sep 2021 19:50:15 +0800 Subject: *misc --- Assets/Scripts/Test 1/TestCamera.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Assets/Scripts/Test 1/TestCamera.cs (limited to 'Assets/Scripts/Test 1/TestCamera.cs') diff --git a/Assets/Scripts/Test 1/TestCamera.cs b/Assets/Scripts/Test 1/TestCamera.cs new file mode 100644 index 00000000..6a6795bd --- /dev/null +++ b/Assets/Scripts/Test 1/TestCamera.cs @@ -0,0 +1,26 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class TestCamera : MonoBehaviour +{ + + // 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; + } +} -- cgit v1.1-26-g67d0