Guest User

Untitled

a guest
Jan 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. [ExecuteInEditMode]
  6. public class CameraResizer : MonoBehaviour
  7. {
  8. public float verticalResolution = 1080;
  9.  
  10. void OnGUI ()
  11. {
  12. float currentAspect = (float) Screen.height / (float) Screen.width;
  13. Camera.main.orthographicSize = verticalResolution / currentAspect / 200;
  14. }
  15. }
Add Comment
Please, Sign In to add comment