Unity Android 动态横竖屏设置 2020-09-23
作者:
保罗柴夫斯基 | 来源:发表于
2020-09-23 20:15 被阅读0次
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;
}
本文标题:Unity Android 动态横竖屏设置 2020-09-23
本文链接:https://www.haomeiwen.com/subject/amaoyktx.html
网友评论