Browse Source

战斗卡牌排序

zhaoyang 3 years ago
parent
commit
77b9ea5684

+ 1 - 21
GameClient/Assets/Game/HotUpdate/Data/ItemDataManager.cs

@@ -149,28 +149,8 @@ namespace GFGGame
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
 
             //五个属性中最大的为主属性
-            mainScore = 1;
+
             mainScoreValue = 0;
-            // if (itemCfg.score1 > mainScoreValue)
-            // {
-            //     mainScoreValue = itemCfg.score1;
-            //     mainScore = 1;
-            // }
-            // if (itemCfg.score2 > mainScoreValue)
-            // {
-            //     mainScoreValue = itemCfg.score2;
-            //     mainScore = 2;
-            // }
-            // if (itemCfg.score3 > mainScoreValue)
-            // {
-            //     mainScoreValue = itemCfg.score3;
-            //     mainScore = 3;
-            // }
-            // if (itemCfg.score4 > mainScoreValue)
-            // {
-            //     mainScoreValue = itemCfg.score4;
-            //     mainScore = 4;
-            // }
             mainScore = itemCfg.mainScore;
             switch (mainScore)
             {

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryCardChoose.cs

@@ -111,8 +111,8 @@ namespace GFGGame
             arrayList.Sort((CardData a, CardData b) =>
             {
 
-                int scoreA = ItemDataManager.GetItemScoreValue(a.id, _scoreType);
-                int scoreB = ItemDataManager.GetItemScoreValue(b.id, _scoreType);
+                int scoreA = a.scores[_scoreType];// ItemDataManager.GetItemScoreValue(a.id, _scoreType);
+                int scoreB = b.scores[_scoreType];//ItemDataManager.GetItemScoreValue(b.id, _scoreType);
 
                 if (scoreA < scoreB)
                 {