다모아 2023. 8. 17. 16:25
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Cam : MonoBehaviour
{
    [SerializeField]
    private Button btn;
    [SerializeField]
    private Transform targetTrans;
    [SerializeField]
    private Transform zoomInPoint;
    [SerializeField]
    private Transform zoomOutPoint;
    // Start is called before the first frame update
    void Start()
    {
        this.btn.onClick.AddListener(() => {
            Debug.Log("클릭");
            this.transform.LookAt(this.targetTrans.position);

            DrawArrow.ForDebug(this.transform.position, this.transform.forward * 3f, 10f, Color.blue, ArrowType.Solid);
            this.zoomInPoint.position = this.transform.position + this.transform.forward * 3f;

            DrawArrow.ForDebug(this.transform.position, -this.transform.forward * 3f, 10f, Color.blue, ArrowType.Solid);
            this.zoomOutPoint.position = this.transform.position + -this.transform.forward * 3f;
        });
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}