From 82931aabaaa3e479bc04e11630a77cd9c9dd5fe3 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期五, 26 十月 2018 20:05:36 +0800
Subject: [PATCH] Merge branch 'master' into leonard

---
 System/Compose/New/ComposeEquipWin.cs |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/System/Compose/New/ComposeEquipWin.cs b/System/Compose/New/ComposeEquipWin.cs
index 9ba18de..33bd95b 100644
--- a/System/Compose/New/ComposeEquipWin.cs
+++ b/System/Compose/New/ComposeEquipWin.cs
@@ -1,6 +1,7 @@
 锘縰sing Snxxz.UI;
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using TableConfig;
 using UnityEngine;
 using UnityEngine.UI;
@@ -210,19 +211,26 @@
                 if (secondTypeDict.Count >= 1 && curSecondType != 0
                     && curThirdType >= 1)
                 {
-                    int remain = curSecondType - firstTypeDict.Count;
-                    if(remain > 0)
-                    {
-                        cellCtrl.JumpIndex(curSecondType- remain);
-                    }
-                    else
-                    {
-                        cellCtrl.JumpIndex(curSecondType - 1);
-                    }
+                    cellCtrl.JumpIndex(GetCurIndex(curSecondType));
                 }
             }
         }
 
+        private int GetCurIndex(int secondType)
+        {
+            int curIndex = 0;
+            List<int> secondlist = firstTypeDict.Keys.ToList();
+            for(int i = 0; i < secondlist.Count; i++)
+            {
+                if(secondType == secondlist[i])
+                {
+                    curIndex = i;
+                    break;
+                }
+            }
+            return curIndex;
+        }
+
         private void RefreshCell(ScrollerDataType type, CellView cell)
         {
             Image icon = cell.transform.Find("BtnIcon").GetComponent<Image>();

--
Gitblit v1.8.0