Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.27 KB | None | 0 0
  1.     private void SetPortraitMode()
  2.     {
  3.         Debug.Log("SetPortraitMode");
  4.         //Screen.orientation = ScreenOrientation.Portrait;
  5.         if(Screen.autorotateToPortrait != true)
  6.         {
  7.             Screen.autorotateToLandscapeLeft = false;
  8.             Screen.autorotateToLandscapeRight = false;
  9.  
  10.             Screen.orientation = ScreenOrientation.Portrait;
  11.  
  12.             Screen.autorotateToPortrait = true;
  13.             Screen.autorotateToPortraitUpsideDown = true;
  14.  
  15.             Screen.orientation = ScreenOrientation.Portrait;
  16.             //Screen.orientation = ScreenOrientation.AutoRotation;
  17.         }
  18.     }
  19.    
  20.     private void SetLandscapeMode()
  21.     {
  22.         Debug.Log("SetLandscapeMode");
  23.         //Screen.orientation = ScreenOrientation.Landscape;
  24.         if (Screen.autorotateToLandscapeRight != true)
  25.         {
  26.             Screen.autorotateToPortrait = false;
  27.             Screen.autorotateToPortraitUpsideDown = false;
  28.  
  29.             Screen.orientation = ScreenOrientation.LandscapeLeft;
  30.  
  31.             Screen.autorotateToLandscapeRight = true;
  32.             Screen.autorotateToLandscapeLeft = true;
  33.             Screen.orientation = ScreenOrientation.LandscapeLeft;
  34.             //Screen.orientation = ScreenOrientation.AutoRotation;
  35.             //DeviceOrientation = DeviceOrientation.LandscapeLeft
  36.         }
  37.  
  38.         //Screen.orientation = ScreenOrientation.AutoRotation;
  39.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement