[英]How to change the screen orientation when switching from one scene to another in UNITY?
I have 4 scenes in my game I need to set scene 1 and scene 3 in landscape mode, scene 2 and scene 4 in portrait mode how can I do this?我的游戏中有 4 个场景 我需要将场景 1 和场景 3 设置为横向模式,将场景 2 和场景 4 设置为纵向模式 我该怎么做? please help me out... I'm searching for a long time but couldn't find out the answer.
请帮帮我...我正在寻找很长时间,但找不到答案。
When you load your scene, you can use加载场景时,您可以使用
Screen.orientation = ScreenOrientation.Portrait;
The available orientations are inScreenOrientation .可用的方向在ScreenOrientation中。
And you can read more about Screen.orientation
here .您可以在此处阅读有关
Screen.orientation
的更多信息。
About loading scenes you can use SceneManager.LoadScene(scenename);
关于加载场景,您可以使用
SceneManager.LoadScene(scenename);
, you can read more here . ,你可以在这里阅读更多。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.