C# Unity以水平模式加载场景

C# Unity以水平模式加载场景,c#,unity3d,C#,Unity3d,我在unity中的应用程序都是垂直的,但我有一个场景,我只需要它是水平的。我该怎么做?我希望这样,当您单击按钮加载场景时,手机会水平转动,然后当它们返回到原始场景时,手机会垂直转动。在唤醒功能中禁用自动旋转: Screen.autorotateToLandscapeRight = false; Screen.autorotateToPortraitUpsideDown = false; Screen.autorotateToPortrait = false; Screen.autorotateT

我在unity中的应用程序都是垂直的,但我有一个场景,我只需要它是水平的。我该怎么做?我希望这样,当您单击按钮加载场景时,手机会水平转动,然后当它们返回到原始场景时,手机会垂直转动。

唤醒功能中禁用自动旋转:

Screen.autorotateToLandscapeRight = false;
Screen.autorotateToPortraitUpsideDown = false;
Screen.autorotateToPortrait = false;
Screen.autorotateToLandscapeLeft = false;
然后可以根据需要更改方向

景观:

Screen.orientation = ScreenOrientation.LandscapeLeft;
肖像:

Screen.orientation = ScreenOrientation.Portrait;

关于检测按钮上的点击,请参阅文章