/// <summary> /// UI 等比缩放 /// </summary> static private void AdaptiveUI() { int ManualWidth = 960; int ManualHeight = 540; UIRoot uiRoot = GameObject.FindObjectOfType<UIRoot>(); if (uiRoot != null) { if (System.Convert.ToSingle(Screen.height) / Screen.width > System.Convert.ToSingle(ManualHeight) / ManualWidth) uiRoot.manualHeight = Mathf.RoundToInt(System.Convert.ToSingle(ManualWidth) / Screen.width * Screen.height); else uiRoot.manualHeight = ManualHeight; } }