From d6161eec964b2eeb23bd93c84c29f8ffd3a2d06f Mon Sep 17 00:00:00 2001
From: chenxin <chenxin6991@163.com>
Date: Thu, 05 Nov 2020 17:26:39 +0800
Subject: [PATCH] Merge commit '323055bb1b4c9b5669676dd799238050279b7d7a' into master

---
 Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs |   42 ++++++++++++++++++++++++++----------------
 1 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs b/Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs
index 0d3107b..574bce8 100644
--- a/Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs
+++ b/Assets/Scripts/TowerDefense/UI/EndlessBossSkill/BossSkillBubbleBomb.cs
@@ -4,6 +4,8 @@
 using UnityEngine;
 using TowerDefense.Agents;
 using TowerDefense.Level;
+using DG.Tweening;
+using MoreMountains.NiceVibrations;
 
 /**
  * 泡泡炸弹
@@ -120,7 +122,6 @@
                     Debug.Log("--------------------- WTF 不支持哦~ ---------------------");
                     break;
                 case EndlessBossSkillUseTarget.Tunel:
-                    EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessBossSkillGlintTitle);
                     SpawnOnTunel();
                     break;
             }
@@ -137,14 +138,15 @@
 
             for (int i = 0; i < tunelIdList.Count; ++i)
             {
-                Poolable poolable = Poolable.TryGetPoolable<Poolable>(prefab);
-                BubbleBombAgent bubbleBomb = poolable.GetComponent<BubbleBombAgent>();
+                GameObject obj = Poolable.TryGetPoolable(prefab);
+                BubbleBombAgent bubbleBomb = obj.GetComponent<BubbleBombAgent>();
 
                 // 分配唯一id
                 bubbleBomb.Id = GameUtils.GetId();
                 bubbleBomb.waveLineID = tunelIdList[i] - 1;
                 bubbleBomb.AgentType = SpawnAgentType.BubbleBomb;
                 bubbleBomb.opponentAgent = false;
+                bubbleBomb.Reset();
 
                 // 出生位置
                 Vector3 spawnPosition = EndlessLevelManager.instance.GetTunelWorldPosition(tunelIdList[i], (EndlessBossSkillTunelType)SkillData.target[1]);
@@ -169,23 +171,29 @@
         protected List<int> GetTunelList()
         {
             List<int> tunelIdList = new List<int>();
-            // cx test 后面改
-            int configTunel = SkillData.tunnel[0];
+            int count = 0;
+            // 剩余没有用到的赛道
+            List<int> remainList = new List<int>() { 1, 2, 3, 4, 5 };
 
-            if (configTunel <= 5)
-                // 直接对应具体的一条赛道
-                tunelIdList.Add(configTunel);
-            else if (configTunel == 6)
+            for (int i = 0; i < SkillData.tunnel.Count; ++i)
             {
-                // 所有赛道
-                for (int i = 1; i <= 5; ++i)
+                // 统计6这种类型的数量
+                if (SkillData.tunnel[i] == 6)
                 {
-                    tunelIdList.Add(i);
+                    ++count;
+                    continue;
                 }
+
+                tunelIdList.Add(SkillData.tunnel[i]);
+                remainList.Remove(SkillData.tunnel[i]);
             }
-            else if (configTunel == 7)
-                // 随机一条
-                tunelIdList.Add(random.Next(1, 6));
+
+            for (int i = 0; i < count; ++i)
+            {
+                int num = random.Next(remainList.Count);
+                tunelIdList.Add(remainList[num]);
+                remainList.Remove(remainList[num]);
+            }
 
             return tunelIdList;
         }
@@ -354,7 +362,9 @@
 
                     if (config.AttackTime <= 0)
                     {
-                        EndlessGameUI.instance.DestroyTowerGrid(config.Agent.waveLineID);
+                        EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessLoseHeart, 3);
+                        ViewPortAdj.instance.cachedCamera.DOShakePosition(0.25f, 1.5f, 4);
+                        MMVibrationManager.Haptic(HapticTypes.HeavyImpact);
                         config.IsAttack = false;
                     }
                 }

--
Gitblit v1.9.1