【背景适配】优化宽屏下背景显示错误

dev_chengFeng
gaoxin 2021-06-25 11:12:22 +08:00
parent 2d8d632436
commit d89d4427c1
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ public class UIBgAdaptive : MonoBehaviour
//float curHeight = 1920 * (Screen.height / Screen.width) / (1920 / 1080);
//float curWidth = (1080f / 1920f) * curHeight;
//bgList[i].GetComponent<RectTransform>().sizeDelta = new Vector2(curWidth, curHeight);
if (Screen.height >= 1920)
if (Screen.height/Screen.width >= 1920/1080f)
{
//--计算比例因子 比例因子 = 10 ^ ((lg(屏幕宽 / 开发宽) + lg(屏幕高 / 开发高) / 2))
//local log = math.log(Screen.width / 1080, 10) + math.log(Screen.height / 1920, 10)