zoukankan      html  css  js  c++  java
  • unity 设置屏幕旋转

    只允许竖屏:

    Portrait                    √

    Portrait Upside Down √

    Landscape Right        ×

    Landscape Left          ×

    只允许横屏:

    Portrait                    ×

    Portrait Upside Down ×

    Landscape Right        √

    Landscape Left          √

    代码动态设置屏幕旋转:

    private void setLandscape(){
        Screen.orientation=ScreenOrientation.Landscape;//如果屏幕是竖屏,则立刻旋转至横屏
    
        //设置只允许横屏旋转
        Screen.autorotateToPortrait           =false;
        Screen.autorotateToPortraitUpsideDown =false;
        Screen.autorotateToLandscapeRight     =true;
        Screen.autorotateToLandscapeLeft      =true;
    
        Screen.orientation=ScreenOrientation.AutoRotation;//再设置为允许自动旋转
    }
  • 相关阅读:
    2020-03-23
    2020-03-22
    2020-03-21
    2020-03-20
    2020-03-19
    2020-03-18
    2020-03-17
    单元测试-java
    2020-03-16
    C语言拯救计划Day3-1之求一批整数中出现最多的个位数字
  • 原文地址:https://www.cnblogs.com/kingBook/p/6490016.html
Copyright © 2011-2022 走看看