| | |
| | | using UnityEngine; |
| | | using TowerDefense.Agents; |
| | | using TowerDefense.Level; |
| | | using DG.Tweening; |
| | | using MoreMountains.NiceVibrations; |
| | | |
| | | /** |
| | | * 泡泡炸弹 |
| | |
| | | Debug.Log("--------------------- WTF 不支持哦~ ---------------------"); |
| | | break; |
| | | case EndlessBossSkillUseTarget.Tunel: |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessBossSkillGlintTitle); |
| | | SpawnOnTunel(); |
| | | break; |
| | | } |
| | |
| | | |
| | | 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]); |
| | |
| | | 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; |
| | | } |
| | |
| | | |
| | | 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; |
| | | } |
| | | } |