简体   繁体   English

我无法统一旋转屏幕

[英]I can't rotate screen in unity

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EkranDöndür : MonoBehaviour
{
    void Start()
    {
        Screen.orientation = ScreenOrientation.LandscapeLeft;
        print("this code is working");
    }

    void Update()
    {
    }
}

I want to use the screen horizontally in a scene of my game我想在我的游戏场景中水平使用屏幕

I tried this code but it didn't work我试过这段代码,但没有用

How can I do it?我该怎么做?

** **

if you want to change the orientation:如果你想改变方向:

Go to Edit > Project Settings > Player it will open Player Settings in the inspector. Go 到 Edit > Project Settings > Player 它将在检查器中打开 Player Settings。 Select the target platform from the list. Select 列表中的目标平台。 Click the Resolution and Presentation section.单击“分辨率和演示文稿”部分。 Set the Default Orientation to Landscape left / right.19将默认方向设置为横向左/右.19

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM