There was an error while loading. Please reload this page.
public class CameraResolution : MonoBehaviour { void Awake() { Camera camera = GetComponent(); Rect rect = camera.rect; float scaleheight = ((float)Screen.width / Screen.height) / ((float)16 / 9); // (세로 / 가로) float scalewidth = 1f / scaleheight; if (scaleheight < 1) { rect.height = scaleheight; rect.y = (1f - scaleheight) / 2f; } else { rect.width = scalewidth; rect.x = (1f - scalewidth) / 2f; } camera.rect = rect; } void OnPreCull() => GL.Clear(true, true, Color.black); }