Orientation Auto Rotation旋轉螢幕crash問題(Unity3D開發之十四),orientationunity3d

來源:互聯網
上載者:User

Orientation Auto Rotation旋轉螢幕crash問題(Unity3D開發之十四),orientationunity3d

猴子原創,歡迎轉載。轉載請註明: 轉載自Cocos2Der-CSDN,謝謝!

原文地址: http://blog.csdn.net/cocos2der/article/details/44133127

今天運行一個情境時候,welcome情境可以旋轉,進入主情境後發現只要旋轉手機螢幕就會crash。

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',reason: 'UnityDefaultViewController should be used only if unity is set to autorotate'

出錯資訊已經顯示是使用auto rotation導致的。

Unity Build setting裡面已經是Auto Rotation,為何主情境無法旋轉?

而且錯誤表示:是我在調用autorotate,但是我設定的模式卻不是autorotate。

最後全域搜尋了下,果然有測試代碼手工設定了螢幕方向為Left。修改為自動後,問題解決。

Screen.orientation = ScreenOrientation.AutoRotation;

問題雖然是個小問題,但是想起了那誰誰前天線上遊戲由於開發寫的測試代碼跑到線上,導致玩家多了一個裝了很多道具的寶箱。

所以,誰要是說:”這個功能先這樣就好了, 等正式配置出來了,我在修改。“,我保證不掐死你…

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.