private void Start() { m_CameraRotator = GetComponentInChildren <CameraRotator> (); m_CameraFlyer = GetComponentInChildren <CameraFlyer> (); if (m_CameraRotator == null) { Debug.LogError("No CameraRotator in a child of CameraSwitcher."); } if (m_CameraFlyer == null) { Debug.LogError("No CameraFlyer in a child of CameraSwitcher."); } if (startWithCameraRotator) { m_CameraRotator.enabled = true; m_CameraFlyer.enabled = false; m_CameraFlyer.Disable(); } else { m_CameraRotator.enabled = false; m_CameraRotator.Disable(); m_CameraFlyer.enabled = true; } }
public void Switch() { if (m_CameraRotator.enabled) { m_CameraRotator.enabled = false; m_CameraRotator.Disable(); m_CameraFlyer.enabled = true; } else { m_CameraRotator.enabled = true; m_CameraFlyer.enabled = false; m_CameraFlyer.Disable(); } }
private void Start() { m_CameraRotator = GetComponentInChildren <CameraRotator> (); m_CameraFlyer = GetComponentInChildren <CameraFlyer> (); if (m_CameraRotator == null) { Debug.LogError ("No CameraRotator in a child of CameraSwitcher."); } if (m_CameraFlyer == null) { Debug.LogError ("No CameraFlyer in a child of CameraSwitcher."); } if (startWithCameraRotator) { m_CameraRotator.enabled = true; m_CameraFlyer.enabled = false; m_CameraFlyer.Disable (); } else { m_CameraRotator.enabled = false; m_CameraRotator.Disable (); m_CameraFlyer.enabled = true; } }