diff --git a/meng_yao/Assets/Config/MapLevel_MonsterInfo_1.txt b/meng_yao/Assets/Config/MapLevel_MonsterInfo_1.txt index f8449555..8b6bf629 100644 --- a/meng_yao/Assets/Config/MapLevel_MonsterInfo_1.txt +++ b/meng_yao/Assets/Config/MapLevel_MonsterInfo_1.txt @@ -96,5 +96,141 @@ {"id": "Enemy_002", "count": 1, "startTime": 500, "Reward": 3} ], "totalReward": 250 + }, + { + "wave": 6, + "spawnPoint": 1, + "enemies": [ + {"id": "Enemy_007", "count": 1, "startTime": 0, "Reward": 8}, + {"id": "Enemy_002", "count": 1, "startTime": 3000, "Reward": 3}, + {"id": "Enemy_002", "count": 1, "startTime": 500, "Reward": 3}, + {"id": "Enemy_002", "count": 1, "startTime": 500, "Reward": 3}, + {"id": "Enemy_002", "count": 1, "startTime": 500, "Reward": 3}, + {"id": "Enemy_007", "count": 1, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_002", "count": 1, "startTime": 500, "Reward": 3}, + {"id": "Enemy_002", "count": 1, "startTime": 500, "Reward": 3}, + {"id": "Enemy_002", "count": 1, "startTime": 500, "Reward": 3}, + {"id": "Enemy_002", "count": 1, "startTime": 500, "Reward": 3}, + {"id": "Enemy_009", "count": 1, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5} + ], + "totalReward": 250 + }, + { + "wave": 7, + "spawnPoint": 1, + "enemies": [ + {"id": "Enemy_012", "count": 1, "startTime": 0, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_011", "count": 1, "startTime": 500, "Reward": 10}, + {"id": "Enemy_012", "count": 1, "startTime": 3000, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_011", "count": 1, "startTime": 500, "Reward": 10}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_011", "count": 1, "startTime": 500, "Reward": 10}, + {"id": "Enemy_012", "count": 1, "startTime": 3000, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_011", "count": 1, "startTime": 500, "Reward": 10}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_012", "count": 1, "startTime": 500, "Reward": 5}, + {"id": "Enemy_011", "count": 1, "startTime": 500, "Reward": 10} + ], + "totalReward": 250 + }, + { + "wave": 8, + "spawnPoint": 1, + "enemies": [ + {"id": "Enemy_010", "count": 1, "startTime": 0, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_008", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_008", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_008", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_010", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_005", "count": 1, "startTime": 500, "Reward": 8}, + {"id": "Enemy_005", "count": 1, "startTime": 500, "Reward": 8} + ], + "totalReward": 250 + }, + { + "wave": 9, + "spawnPoint": 1, + "enemies": [ + {"id": "Enemy_002", "count": 2, "startTime": 0, "Reward": 3}, + {"id": "Enemy_003", "count": 2, "startTime": 500, "Reward": 3}, + {"id": "Enemy_002", "count": 2, "startTime": 500, "Reward": 3}, + {"id": "Enemy_003", "count": 2, "startTime": 500, "Reward": 3}, + {"id": "Enemy_002", "count": 2, "startTime": 500, "Reward": 3}, + {"id": "Enemy_003", "count": 2, "startTime": 500, "Reward": 3}, + {"id": "Enemy_002", "count": 2, "startTime": 500, "Reward": 3}, + {"id": "Enemy_003", "count": 1, "startTime": 500, "Reward": 3}, + {"id": "Enemy_002", "count": 1, "startTime": 500, "Reward": 3}, + {"id": "Enemy_010", "count": 2, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_006", "count": 2, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_010", "count": 2, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_006", "count": 2, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_010", "count": 2, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_006", "count": 2, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_010", "count": 2, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_006", "count": 2, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_010", "count": 2, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_006", "count": 2, "startTime": 3000, "Reward": 8}, + {"id": "Enemy_006", "count": 2, "startTime": 3000, "Reward": 8} + ], + "totalReward": 250 + }, + { + "wave": 10, + "spawnPoint": 3, + "enemies": [ + {"id": "Enemy_004", "count": 3, "startTime": 0, "Reward": 3}, + {"id": "Enemy_004", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_004", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_009", "count": 3, "startTime": 500, "Reward": 8}, + {"id": "Enemy_004", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_004", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_004", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_003", "count": 3, "startTime": 3000, "Reward": 3}, + {"id": "Enemy_003", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_003", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_008", "count": 3, "startTime": 500, "Reward": 8}, + {"id": "Enemy_003", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_003", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_003", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_001", "count": 3, "startTime": 3000, "Reward": 3}, + {"id": "Enemy_001", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_001", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_006", "count": 3, "startTime": 500, "Reward": 8}, + {"id": "Enemy_001", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_001", "count": 3, "startTime": 500, "Reward": 3}, + {"id": "Enemy_001", "count": 3, "startTime": 500, "Reward": 3} + ], + "totalReward": 250 } ] diff --git a/meng_yao/Assets/script/A_Fight/SpawnMonster.cs b/meng_yao/Assets/script/A_Fight/SpawnMonster.cs index d3d60ec7..5494272a 100644 --- a/meng_yao/Assets/script/A_Fight/SpawnMonster.cs +++ b/meng_yao/Assets/script/A_Fight/SpawnMonster.cs @@ -14,6 +14,19 @@ public class SpawnMonster : Base [Header("临时索引")] private int index=1; + public int Index + { + + get => index; + set + { + index=value; + StartSpawning(); + } + + } + + public List enemysList=new List(); private void Awake() diff --git a/meng_yao/Assets/script/A_Fight/UIContorl.cs b/meng_yao/Assets/script/A_Fight/UIContorl.cs index 31de87ce..f26f097c 100644 --- a/meng_yao/Assets/script/A_Fight/UIContorl.cs +++ b/meng_yao/Assets/script/A_Fight/UIContorl.cs @@ -28,7 +28,18 @@ public class UIContorl : Base } } public Text KIllNumberText; - public int maxEnemynumber; + private int maxEnemynumber; + public int MaxEnemynumber + { + get => maxEnemynumber; + set + { + maxEnemynumber = value; + Debug.Log("maxEnemynumber:" + maxEnemynumber); + this.KIllNumberText.text = killnumber + "/" + maxEnemynumber; + } + } + private int killnumber; public int Killnumber { @@ -57,10 +68,15 @@ public class UIContorl : Base private float timeElapsed = 0f; // 记录经过的时间 private bool isTimerRunning = false; // 控制计时器是否运行 // Start is called before the first frame update - void Start() + void Awake() { if (instance != null) return; instance = this; + } + + void Start() + { + //FightBtn.onClick.AddListener(FightClick); Battle_Time.text = "00:00"; diff --git a/meng_yao/Assets/script/A_Fight/json/MapLevelJsonRead.cs b/meng_yao/Assets/script/A_Fight/json/MapLevelJsonRead.cs index 3891cb17..f0bea5bc 100644 --- a/meng_yao/Assets/script/A_Fight/json/MapLevelJsonRead.cs +++ b/meng_yao/Assets/script/A_Fight/json/MapLevelJsonRead.cs @@ -8,10 +8,27 @@ public class MapLevelJsonRead : JsonReadBase public List waves; public TextAsset MapLevelJson; + public int count = 0; + void Awake() { - instance=this; + instance = this; waves = base.LoadJson(MapLevelJson); + + + } + + void Start() + { + foreach (Wave value in waves) + { + count += value.enemies.Count; + Debug.Log("一个:" + value.enemies.Count); + } + + Debug.Log("总:" + this.count); + + UIContorl.instance.MaxEnemynumber = this.count; } } @@ -29,5 +46,4 @@ public struct Wave public int spawnPoint; // 生成点 public List enemies; // 敌人列表 public int totalReward; // 总奖励 -} - +} \ No newline at end of file