Ver Fonte

修复死循环的问题

WGL há 1 mês atrás
pai
commit
5938f61b9c
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      ActionTowerDefense/Assets/Scripts/UI/ShopUI.cs

+ 3 - 1
ActionTowerDefense/Assets/Scripts/UI/ShopUI.cs

@@ -68,8 +68,10 @@ public class ShopUI : MonoBehaviour
             {
                 a = 3;
             }
-            while (true)
+            int b = 0;
+            while (b < 10)
             {
+                b++;
                 randId = Random.Range(0, singleTreasureConfigs.Count);
                 if (!randomTreasure.Exists(x => x == singleTreasureConfigs[randId].ID))
                 {