浏览代码

修复购买冲刺加成的宝物会卡死的问题

WGL 1 月之前
父节点
当前提交
61895512c6
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      ActionTowerDefense/Assets/Scripts/GameManager.cs

+ 4 - 4
ActionTowerDefense/Assets/Scripts/GameManager.cs

@@ -334,14 +334,14 @@ public class GameManager : MonoBehaviour
                     dashCharges += (int)data;
                     player.rushChargeTotalNums += (int)data;
                     player.rushChargeNums = player.rushChargeTotalNums;
-                    for (int j = 0; i < player.rushChargeTotalNums; j++)
+                    for (int j = 0; j < player.rushChargeTotalNums; j++)
                     {
-                        if (player.uiRush.childCount <= i)
+                        if (player.uiRush.childCount <= j)
                         {
                             Transform rushUIchid = Instantiate(player.uiRush.GetChild(0), player.uiRush);
-                            rushUIchid.localPosition = player.uiRush.GetChild(0).transform.localPosition + Vector3.right * 50 * i;
+                            rushUIchid.localPosition = player.uiRush.GetChild(0).transform.localPosition + Vector3.right * 50 * j;
                         }
-                        UIController.ChangeImageFill(player.uiRush.GetChild(i).GetComponent<Image>(), 1);
+                        UIController.ChangeImageFill(player.uiRush.GetChild(j).GetComponent<Image>(), 1);
                     }
                     break;
                 case "":