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

    void Update () {
      //处理横向两个方向旋转
      if(Input.deviceOrientation == DeviceOrientation.LandscapeLeft)
      {
       if (Screen.orientation != ScreenOrientation.LandscapeLeft) {
        Screen.orientation = ScreenOrientation.LandscapeLeft;
       }
      }else if(Input.deviceOrientation == DeviceOrientation.LandscapeRight)
      {
       if (Screen.orientation != ScreenOrientation.LandscapeRight) {
        Screen.orientation = ScreenOrientation.LandscapeRight;
       }
       
      }else
      //处理纵向两个方向的旋转
      if(Input.deviceOrientation == DeviceOrientation.Portrait)
      {
       if (Screen.orientation != ScreenOrientation.Portrait) {
        Screen.orientation = ScreenOrientation.Portrait;
       }
      }else if(Input.deviceOrientation == DeviceOrientation.PortraitUpsideDown)
      {
       if (Screen.orientation != ScreenOrientation.PortraitUpsideDown) {
        Screen.orientation = ScreenOrientation.PortraitUpsideDown;
       }
      }
     }

  • 相关阅读:
    团队冲刺03
    梦断代码 阅读笔记02
    团队冲刺02
    团队冲刺01
    周总结
    团队工作任务
    阅读笔记3
    梦断代码阅读笔记01
    周总结
    NABCD项目分析
  • 原文地址:https://www.cnblogs.com/softimagewht/p/2257210.html
Copyright © 2011-2022 走看看