浏览代码

爬塔界面适配问题修改

zhangyuqian 11 月之前
父节点
当前提交
2d1ab424b5
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      GameClient/Assets/Game/HotUpdate/Views/FieldWork/FieldWorkLevelView.cs

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Views/FieldWork/FieldWorkLevelView.cs

@@ -119,11 +119,11 @@ namespace GFGGame
                     isPassCount++;
                 }
             }
-            int levelCount = CimbingTowerLevelCfgArray.Instance.dataArray.Length - isPassCount;
+            float levelCount = CimbingTowerLevelCfgArray.Instance.dataArray.Length - isPassCount;
             float height = _ui.m_chapter.target.height;
-            float value = 300 / (_ui.m_chapter.target.height / 1080.0f);
+            float value = levelCount / CimbingTowerLevelCfgArray.Instance.dataArray.Length;
             indexY = value * Mathf.Max(0, (float)levelCount);
-            _ui.m_chapter.target.scrollPane.posY = indexY;
+            _ui.m_chapter.target.scrollPane.SetPercY(value, false);
         }
         private void OnClickLevelItem(EventContext context)
         {