Unity/Asset 분석

[RTS Engine] 카메라가 특정 Unit을 Follow

lipnus 2021. 7. 15. 20:02
반응형

SelectionManager에서 설정을 받아서 MainCameraManager에서 구현

Camera Follow / Space키를 눌러서 토글

 

SelectionManager.cs

[SerializeField]
        private CameraFollow camFollow = new CameraFollow { enabled = true, key = KeyCode.Space, iterate = true };

 

CameraController.cs

        public void SetFollowTarget (Transform transform) {
            followTarget = transform;
            //reset movement inputs
            currPanDirection = Vector3.zero;
            lastPanDirection = Vector3.zero;
        }

 

 

 

반응형