diff options
author | chai <chaifix@163.com> | 2021-09-11 19:50:15 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-09-11 19:50:15 +0800 |
commit | a9d460f503f4d09a4c0e00164c6ca1ba3f8725dd (patch) | |
tree | 72d06846b7425e6e4ee9ce59db4b767856fcb531 /Assets/Scripts/Test 1/TestCamera.cs | |
parent | b40a0e5c925b4c2c0cbef21c6e28fd83cf2e246b (diff) |
*misc
Diffstat (limited to 'Assets/Scripts/Test 1/TestCamera.cs')
-rw-r--r-- | Assets/Scripts/Test 1/TestCamera.cs | 26 |
1 files changed, 26 insertions, 0 deletions
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<UnitController>().center.x;
+ pos.y = TestErika.Instance.erika.unitController.GetComponent<UnitController>().center.y;
+ transform.position = pos;
+ }
+}
|