From 6a05b92a9add5eaed3042c1144a07e18b15775f5 Mon Sep 17 00:00:00 2001
From: chenxin <chenxin6991@163.com>
Date: Fri, 04 Dec 2020 15:49:25 +0800
Subject: [PATCH] 新增几个boss资源

---
 Assets/Scripts/TowerDefense/Level/EndlessWaveManager.cs |   42 +++++++-----------------------------------
 1 files changed, 7 insertions(+), 35 deletions(-)

diff --git a/Assets/Scripts/TowerDefense/Level/EndlessWaveManager.cs b/Assets/Scripts/TowerDefense/Level/EndlessWaveManager.cs
index d79cf06..521f107 100644
--- a/Assets/Scripts/TowerDefense/Level/EndlessWaveManager.cs
+++ b/Assets/Scripts/TowerDefense/Level/EndlessWaveManager.cs
@@ -114,7 +114,6 @@
             HideTunel();
             EventCenter.Ins.Add<float>((int)KTGMGemClient.EventType.EndlessAgentTaskDamage, OnHit);
             EventCenter.Ins.Add<int>((int)KTGMGemClient.EventType.WaveLineFinish, WaveLineFinish);
-
         }
 
         /// <summary>
@@ -168,6 +167,11 @@
             InitPortData(level);
             InitWaveData();
             RefreshBoss();
+
+            endless_boss boss = EndlessBossData.GetDataById(waveData[0].Config.resource);
+
+            if (boss != null)
+                EndlessBossCtrl.instance.RefreshBody(boss.image);
 
             if (!GameConfig.IsNewbie)
             {
@@ -227,37 +231,6 @@
             {
                 int tunel = waveData[i].Config.tunel;
                 int tunelBgId = waveData[i].Config.tunel_bg;
-
-                // string key = $"{faZhenPath}{tunelBgId}{tunelBgId}";
-                // List<GameObject> allPS;
-                // GameObject tmpPSObj = null;
-                // if (faZhenDic.ContainsKey(key))
-                // {
-                //     allPS = faZhenDic[key];
-                //     foreach (GameObject item in allPS)
-                //     {
-                //         if (item.activeSelf)
-                //         {
-                //             tmpPSObj = item;
-                //             break;
-                //         }
-                //     }
-                // }
-
-                // if (tmpPSObj == null)
-                // {
-                //     allPS = new List<GameObject>();
-                //     GameObject obj = Resources.Load<GameObject>($"{faZhenPath}{tunelBgId}{tunelBgId}");
-                //     GameObject faZhen = Instantiate(obj);
-                //     tmpPSObj = faZhen;
-                //     allPS.Add(faZhen);
-                //     faZhenDic.Add(key, allPS);
-                // }
-
-                // tmpPSObj.transform.SetParent(TunelList[tunel - 1].gameObject.transform);
-                // tmpPSObj.transform.localPosition = new Vector3(0, 1, 0);
-                // tmpPSObj.transform.localScale = new Vector3(2, 2, 2);
-                // TunelList[tunel - 1].gameObject.SetActive(true);
                 TunelList[tunel - 1].material = Resources.Load<Material>($"{tunelMaterialPath}{tunelBgId}");
                 GameObject obj = Resources.Load<GameObject>($"{faZhenPath}{tunelBgId}{tunelBgId}");
                 GameObject faZhen = Instantiate(obj);
@@ -313,7 +286,6 @@
             return waves[waveline].StartingNode.GetNextNode().transform.position;
         }
 
-
         private void RefreshBoss()
         {
             if (CurrentWaveIndex > 0 || TotalWaves == 1)
@@ -327,15 +299,15 @@
                 int level = GameConfig.IsNewbieStart ? Level - EndlessPortData.NewbieTotalLevel : Level;
                 EndlessBossHPManager.instance.SetBossInfo($"第{level}关 {waveData[0].Config.boss_name}");
             }
+
             EndlessBossHPManager.instance.UpdateWave(TotalWaves - CurrentWaveIndex);
             EndlessBossHPManager.instance.ShowHP();
             EndlessScoreManager.instance.ShowScore();
             EndlessLevelManager.instance.DropRate = EndlessPortData.GetDropRate(Level, CurrentWaveIndex);
             reward tmpData = EndlessPortData.GetDropReward(Level, CurrentWaveIndex);
-            //if(tmpData!=null && tmpData.type == Protobuf.CURRENCY.Arenaexp)//暂时没法判断,需要新加字段
+
             if (tmpData != null)
                 EndlessLevelManager.instance.DropCoin = tmpData != null ? tmpData.count : 0;
-
         }
 
         /// <summary>

--
Gitblit v1.9.1