Orientation Auto Rotation Rotating screen crash problem (Unity3d development 14)

Source: Internet
Author: User

Monkey original, welcome reprint. Reproduced please specify: Reproduced from COCOS2DER-CSDN, thank you!

Original address: http://blog.csdn.net/cocos2der/article/details/44133127

When running a scene today, the welcome scene can be rotated, entering the main scene and discovering that it will crash as soon as you rotate the phone screen.

to‘NSInternalInconsistencyException‘,‘UnityDefaultViewController should be used ifissetto autorotate‘

The error message has been shown to be caused by using auto rotation.

Unity Build setting is already auto Rotation, why can't the main scene rotate?

And the error says: I'm calling Autorotate, but the pattern I'm setting is not autorotate.

The final global search under, sure enough to have the test code manually set the screen orientation to left. After modifying to Automatic, the problem is resolved.

Screen.orientation = ScreenOrientation.AutoRotation;

Although the problem is a small problem, but think of that who the day before yesterday's online game due to the development of written test code ran to the line, resulting in a lot of players with a large number of props in the chest.

So, who says: "This function first this is good, and so on the formal configuration, I am in the revision." "I promise not to strangle you ...

Orientation Auto Rotation Rotating screen crash problem (Unity3d development 14)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.