コード例 #1
0
    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;
        }
    }
コード例 #2
0
 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();
     }
 }
コード例 #3
0
ファイル: CameraSwitcher.cs プロジェクト: Wild/Party-Crash
    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;
        }
    }