| 123456789101112131415161718192021222324 | 
							- using UnityEngine;
 
- public class GameCamera : MonoBehaviour
 
- {
 
-     float devWidth = 10.8f;
 
-     // Start is called before the first frame update
 
-     void Start()
 
-     {
 
-         float screenHeight = Screen.height;
 
-         // Debug.Log("screenHeight = " + screenHeight);
 
-         float orthographicSize = this.GetComponent<Camera>().orthographicSize;
 
-         float aspectRatio = Screen.width * 1.0f / Screen.height;
 
-         float cameraWidth = orthographicSize * 2 * aspectRatio;
 
-         // Debug.Log("cameraWidth = " + cameraWidth);
 
-         if (cameraWidth < devWidth)
 
-         {
 
-             orthographicSize = devWidth / (2 * aspectRatio);
 
-             // Debug.Log("new orthographicSize = " + orthographicSize);
 
-             this.GetComponent<Camera>().orthographicSize = orthographicSize;
 
-         }
 
-     }
 
- }
 
 
  |