summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Test 1/TestCamera.cs
blob: 62b3a2d97ac3e0d9ca2e912522b4a8e37f8216c7 (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
28
29
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;
        pos.x = TestErika.Instance.erika.unitController.transform.position.x;
        pos.y = TestErika.Instance.erika.unitController.transform.position.y;
        transform.position = pos + offset;
    }
}