using Cinemachine; using UnityEngine; public class TowerCam : MonoBehaviour { private GameObject m_gameObject; private void Start() { if (m_gameObject == null) m_gameObject = this.gameObject; } public void ChangeToTarget(GameObject target) { if (target != null) { m_gameObject.GetComponent().m_LookAt = target.transform; m_gameObject.GetComponent().m_Follow = target.transform; m_gameObject.GetComponent().m_Priority = 11; } else { m_gameObject.GetComponent().m_Priority = 9; } } }