summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Test 1/TestCamera.cs
blob: 340a2eb5849aa9df0c15ca7eba79ae5778d33f16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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<UnitController>().center.x;
        pos.y = TestErika.Instance.erika.unitController.GetComponent<UnitController>().center.y;
        transform.position = pos + offset;
    }
}