This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| /// <summary> | |
| /// Keeps constant camera width instead of height, works for both Orthographic & Perspective cameras | |
| /// Made for tutorial https://youtu.be/0cmxFjP375Y | |
| /// </summary> | |
| public class CameraConstantWidth : MonoBehaviour | |
| { | |
| public Vector2 DefaultResolution = new Vector2(720, 1280); | |
| [Range(0f, 1f)] public float WidthOrHeight = 0; |