/// <summary>
/// UI 等比缩放
/// </summary>
static private void AdaptiveUI()
{
int ManualWidth = ;
int ManualHeight = ;
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;
}
}
相关文章
- 09-23Illustrator 教程,如何在 Illustrator 文档中缩放和平移?
- 09-23MPAndroidChart在缩放时更改数据值
- 09-23opencv学习:学习如何对图像进行缩放、剪切、移位等处理
- 09-23opencv 缩放、平移、旋转、仿射变换和透视变换-08
- 09-23NGUI Camera's raycast hit through the UI Layer issue
- 09-23movable-view组件(拖拽缩放)
- 09-23设置viewport进行缩放
- 09-23flutter实现可缩放可拖拽双击放大的图片功能 仅做记录
- 09-23简单的支持网页画框拖拽缩放功能的js插件
- 09-23unity手指缩放控制动画的播放和倒播