Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- [ExecuteInEditMode]
- public class CameraResizer : MonoBehaviour
- {
- public float verticalResolution = 1080;
- void OnGUI ()
- {
- float currentAspect = (float) Screen.height / (float) Screen.width;
- Camera.main.orthographicSize = verticalResolution / currentAspect / 200;
- }
- }
Add Comment
Please, Sign In to add comment