瀏覽代碼

人物类宝物效果

WGL 1 月之前
父節點
當前提交
024f0b34ec
共有 1 個文件被更改,包括 32 次插入3 次删除
  1. 32 3
      ActionTowerDefense/Assets/Scripts/GameManager.cs

+ 32 - 3
ActionTowerDefense/Assets/Scripts/GameManager.cs

@@ -1,11 +1,11 @@
 using cfg;
 using SimpleJSON;
-using System.Collections;
+using Sirenix.OdinInspector;
 using System.Collections.Generic;
 using System.IO;
-using UnityEngine;
 using TMPro;
-using Sirenix.OdinInspector;
+using UnityEngine;
+using UnityEngine.UI;
 
 public enum SoldierType
 {
@@ -50,6 +50,9 @@ public class GameManager : MonoBehaviour
     [FoldoutGroup("Rogue数值")] [LabelText("血量上限")] public int totalHp;
     [FoldoutGroup("Rogue数值")] [LabelText("金币获得增加")] public int increasedGoldGain;
     [FoldoutGroup("Rogue数值")] [LabelText("经验获得增加")] public int increasedEXPGain;
+    [FoldoutGroup("Rogue数值")] [LabelText("冲刺次数")] public int dashCharges;
+    [FoldoutGroup("Rogue数值")] [LabelText("蓝量")] public int totalMp;
+    [FoldoutGroup("Rogue数值")] [LabelText("回蓝速度")] public int mpRegen;
 
     public LeveType leveType;
     [LabelText("下一关倍率增幅")] public List<float> ratioIncrease = new List<float> { 0.4f, 1.6f, -0.8f };
@@ -215,6 +218,7 @@ public class GameManager : MonoBehaviour
 
     public void GetTreasure(Treasure treasure)
     {
+        PlayerController player = PlayersInput.instance[0];
         for (int i = 0; i < treasure.type.Count; i++)
         {
             float data = treasure.data[i];
@@ -247,6 +251,31 @@ public class GameManager : MonoBehaviour
                 case "经验获得增加":
                     increasedEXPGain += (int)data;
                     break;
+                case "冲刺次数":
+                    dashCharges += (int)data;
+                    player.rushChargeTotalNums += (int)data;
+                    player.rushChargeNums = player.rushChargeTotalNums;
+                    for (int j = 0; i < player.rushChargeTotalNums; j++)
+                    {
+                        if (player.uiRush.childCount <= i)
+                        {
+                            Transform rushUIchid = Instantiate(player.uiRush.GetChild(0), player.uiRush);
+                            rushUIchid.localPosition = player.uiRush.GetChild(0).transform.localPosition + Vector3.right * 50 * i;
+                        }
+                        UIController.ChangeImageFill(player.uiRush.GetChild(i).GetComponent<Image>(), 1);
+                    }
+                    break;
+                case "蓝量":
+                    totalMp += (int)data;
+                    player.totalMp += (int)data;
+                    player.mp = player.totalMp;
+                    player.uiMp.Show(player.mp, player.totalMp);
+                    break;
+                case "回蓝速度":
+                    mpRegen += (int)data;
+                    player.mpReplySpeed += (int)data;
+                    break;
+                    
             }
         }
     }