UNITY3D开发IOS 强制屏幕四个方向不旋转的方法

void Start () {
	    //纵向 上下 两个方向
	    iPhoneKeyboard.autorotateToPortrait = false;
	    iPhoneKeyboard.autorotateToPortraitUpsideDown = false;
	 
	    //横向 上下两个方向
	    iPhoneKeyboard.autorotateToLandscapeLeft = false;
	    iPhoneKeyboard.autorotateToLandscapeRight = false;
}


Input.deviceOrientation 可以得到当前IOS 设备屏幕的方向状态。
Screen.orientation 设置屏幕的反转情况

详细的请转到MOMO的博客 http://www.xuanyusong.com/archives/556

猜你喜欢

转载自zhboy666666.iteye.com/blog/1680460