原文地址:http://m.blog.daum.net/creazier/15309864
#if UNITY_IPHONE || UNITY_ANDROID
#if UNITY_3_5 || UNITY_3_6 || UNITY_3_7 || UNITY_3_8 || UNITY_3_9 || UNITY_4_0 || UNITY_4_1
|| UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8
|| UNITY_4_9
Screen.autorotateToPortrait = autoRotateKeyboardPortrait;
Screen.autorotateToPortraitUpsideDown = autoRotateKeyboardPortraitUpsideDown;
Screen.autorotateToLandscapeLeft = autoRotateKeyboardLandscapeLeft;
Screen.autorotateToLandscapeRight = autoRotateKeyboardLandscapeRight;
Screen.autorotateToPortrait = autoRotateKeyboardPortrait;
#else
iPhoneKeyboard.autorotateToPortrait = autoRotateKeyboardPortrait;
iPhoneKeyboard.autorotateToPortraitUpsideDown = autoRotateKeyboardPortraitUpsideDown;
iPhoneKeyboard.autorotateToLandscapeLeft = autoRotateKeyboardLandscapeLeft;
iPhoneKeyboard.autorotateToLandscapeRight = autoRotateKeyboardLandscapeRight;
#endif |