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)