hch
2025-09-16 d4ea9a90ea9f6f8c2f0a326dea2525c1b4b17a85
0312 适配尺寸问题
2个文件已修改
9 ■■■■ 已修改文件
Main/System/ItemTip/SmallTipWin.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/UIBase/UIBase.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/ItemTip/SmallTipWin.cs
@@ -57,7 +57,8 @@
        Vector2 adjustedPos = new Vector2(worldPos.x, worldPos.y + (!isDownShow ? screenHeight * 0.5f : -screenHeight * 0.5f));
        Vector2 screenAdjustedPos = CameraManager.uiCamera.WorldToScreenPoint(adjustedPos);
        screenAdjustedPos.x = Mathf.Clamp(screenAdjustedPos.x, rectTransform.rect.width * 0.5f, Screen.width - rectTransform.rect.width * 0.5f);
        var rectWidth = rectTransform.rect.width * Screen.width / canvasScaler.referenceResolution.x;
        screenAdjustedPos.x = Mathf.Clamp(screenAdjustedPos.x, rectWidth * 0.5f, Screen.width - rectWidth * 0.5f);
        screenAdjustedPos.y = Mathf.Clamp(screenAdjustedPos.y, rectTransform.rect.height * 0.5f, Screen.height - rectTransform.rect.height * 0.5f - 15);
        adjustedPos = CameraManager.uiCamera.ScreenToWorldPoint(screenAdjustedPos);
Main/System/UIBase/UIBase.cs
@@ -107,7 +107,11 @@
    protected Vector3 originalPosition;
    protected Sequence currentAnimation;
    private CanvasScaler canvasScaler;
    public CanvasScaler canvasScaler
    {
        get;
        private set;
    }
    public const int SafeHeightUp = 50;
    public const int SafeHeightDown = 30;