public void UpdateAspectRatio(float newratio) { AspectRatio = newratio; if (!Screen.fullScreen) { int width = Mathf.RoundToInt((float)Screen.height * AspectRatio); Screen.SetResolution(width, Screen.height, fullscreen: false); } if (!PlayerPrefs.HasKey("width")) { PlayerPrefs.SetInt("width", Mathf.RoundToInt((float)PlayerPrefs.GetInt("height") * AspectRatio)); } MainUIController.UpdateBlackBars(); }