Android已通过,IOS未测试
//设置横屏
public override void SetScreenLandscape()
{
Screen.orientation = ScreenOrientation.Landscape;
Screen.autorotateToPortrait = false;
Screen.autorotateToPortraitUpsideDown = false;
Screen.autorotateToLandscapeLeft = true;
Screen.autorotateToLandscapeRight = true;
}
//设置竖屏
public override void SetScreenPortrait()
{
Screen.orientation = ScreenOrientation.Portrait;
Screen.autorotateToPortrait = true;
Screen.autorotateToPortraitUpsideDown = true;
Screen.autorotateToLandscapeLeft = false;
Screen.autorotateToLandscapeRight = false;
}