瀏覽代碼

每下一关波次属性增幅

WGL 3 月之前
父節點
當前提交
e485d02dd8
共有 2 個文件被更改,包括 12 次插入2 次删除
  1. 8 2
      ActionTowerDefense/Assets/Scripts/EnemyCreater.cs
  2. 4 0
      ActionTowerDefense/Assets/Scripts/GameManager.cs

+ 8 - 2
ActionTowerDefense/Assets/Scripts/EnemyCreater.cs

@@ -389,8 +389,14 @@ public class EnemyCreater : MonoBehaviour
     //³ö¹Ö±íÿһÐйÖ
     public void CreateEnemy(SingleCreateEnemyConfig cfg, Vector3 pos, bool active = false)
     {
-        CreateEnemyInit(cfg.EnemyName, cfg.WaveName,
-            cfg.HPRatio, cfg.AttackRatio, cfg.SpeedRatio, cfg.ArmorRatio, cfg.ArmorPiercingRatio,
+        float ratio = GameManager.instance.levelRatio;
+        CreateEnemyInit(cfg.EnemyName,
+            cfg.WaveName,
+            cfg.HPRatio * ratio,
+            cfg.AttackRatio * ratio,
+            cfg.SpeedRatio * ratio,
+            cfg.ArmorRatio * ratio,
+            cfg.ArmorPiercingRatio * ratio,
             pos, active);
     }
 

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

@@ -5,6 +5,7 @@ using System.Collections.Generic;
 using System.IO;
 using UnityEngine;
 using TMPro;
+using Sirenix.OdinInspector;
 
 public enum SoldierType
 {
@@ -29,6 +30,8 @@ public class GameManager : MonoBehaviour
     public LeveType leveType;
     public GameObject nextLevelButton;
     public bool isGaming;
+    [LabelText("ÏÂÒ»¹Ø±¶ÂÊÔö·ù")] public float ratioIncrease = 0.4f;
+    [DisplayOnly] public float levelRatio = 1;
 
     private JSONNode Loader(string fileName)
     {
@@ -119,6 +122,7 @@ public class GameManager : MonoBehaviour
     {
         nextLevelButton.SetActive(false);
 
+        levelRatio += ratioIncrease;
         switch (leveType)
         {
             case LeveType.Introduction: