danny1995

ScreenRotation

Jun 30th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class ScreenRoation : MonoBehaviour
  6. {
  7.     [SerializeField] bool isLandscape;
  8.     [SerializeField] bool isPotrait;
  9.  
  10.     private void Awake()
  11.     {
  12.         if(isLandscape)
  13.             Screen.orientation = ScreenOrientation.LandscapeLeft;
  14.  
  15.         else if(isPotrait)
  16.             Screen.orientation = ScreenOrientation.Portrait;
  17.  
  18.     }
  19. }
Add Comment
Please, Sign In to add comment