WGL 1 месяц назад
Родитель
Сommit
75e1052140

+ 9 - 10
ActionTowerDefense/Assets/Scripts/UI/ShopUI.cs

@@ -34,15 +34,14 @@ public class ShopUI : MonoBehaviour
 
         moneyText.text = $"{gameManager.money}";
         refreshPriceText.text = $"-{refreshPrice}";
-        List<int> randomTreasure = new List<int>();
-        List<List<List<SingleTreasureConfig>>> treasureLists = new List<List<List<SingleTreasureConfig>>>(gameManager.treasuresList);
-        for (int i = 0; i < 5; i++)
-        {
-            if (treasuresSaleUI[i].islock)
-            {
-                randomTreasure.Add(treasuresSaleUI[i].treasure.id);
-            }
-        }
+        //List<int> randomTreasure = new List<int>();
+        //for (int i = 0; i < 5; i++)
+        //{
+        //    if (treasuresSaleUI[i].islock)
+        //    {
+        //        randomTreasure.Add(treasuresSaleUI[i].treasure.id);
+        //    }
+        //}
         for (int i = 0; i < 5; i++)
         {
             if (treasuresSaleUI[i].islock)
@@ -130,7 +129,7 @@ public class ShopUI : MonoBehaviour
                 );
             treasuresSaleUI[i].treasure = treasure;
             treasuresSaleUI[i].Init();
-            randomTreasure.Add(singleTreasureConfig.ID);
+            //randomTreasure.Add(singleTreasureConfig.ID);
         }
         DrawUIPolygon();
         DrawBag();

+ 11 - 2
ActionTowerDefense/Assets/Scripts/UI/TreasuresSaleUI.cs

@@ -152,11 +152,20 @@ public class TreasuresSaleUI : MonoBehaviour
         }
         List<int> tagsId = gameManager.myTreasuresTag;
         int maxId = tagsId[0];
+        int id = -1;
+        if(maxId != 0)
+        {
+            id = 0;
+        }
         for (int i = 1; i < 8; i++)
         {
-            maxId = Mathf.Max(maxId, tagsId[i]);
+            if(maxId < tagsId[i])
+            {
+                maxId = tagsId[i];
+                id = i;
+            }
         }
-        gameManager.maxTreasuresTag = maxId;
+        gameManager.maxTreasuresTag = id;
         shopUI.DrawUIPolygon();
         shopUI.DrawBag();
         gameObject.SetActive(false);