private void Awake() { ShipCamera[] cameras = GetComponentsInChildren <ShipCamera>(); frontCamera = cameras[0]; observerCamera = cameras[1]; currentCamera = observerCamera; frontCamera.gameObject.SetActive(false); isCurrentlyFrontCamera = false; }
private void ToggleView() { frontCamera.gameObject.SetActive(!isCurrentlyFrontCamera); observerCamera.gameObject.SetActive(isCurrentlyFrontCamera); isCurrentlyFrontCamera = !isCurrentlyFrontCamera; currentCamera.SetRadarMode(false); currentCamera = isCurrentlyFrontCamera ? frontCamera : observerCamera; currentCamera.SetRadarMode(radarOn); }