From 38136a34de9aa36bf15ec7471abd56e2cba6c26f Mon Sep 17 00:00:00 2001
From: chenxin <chenxin6991@163.com>
Date: Tue, 27 Oct 2020 17:39:17 +0800
Subject: [PATCH] 修改无尽模式新手引导流程能全部跑通了

---
 Assets/Scripts/TowerDefense/Level/EndlessWaveLineManager.cs |   39 +++++++++++++++++++++------------------
 1 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/Assets/Scripts/TowerDefense/Level/EndlessWaveLineManager.cs b/Assets/Scripts/TowerDefense/Level/EndlessWaveLineManager.cs
index 1d416dd..037e498 100644
--- a/Assets/Scripts/TowerDefense/Level/EndlessWaveLineManager.cs
+++ b/Assets/Scripts/TowerDefense/Level/EndlessWaveLineManager.cs
@@ -19,17 +19,17 @@
     /// <summary>
     /// 火攻击效果
     /// </summary>
-    public ParticleSystem skillFirePrefab;
+    public GameObject skillFirePrefab;
 
     /// <summary>
     /// 炸弹攻击效果
     /// </summary>
-    public ParticleSystem skillBombPrefab;
+    public GameObject skillBombPrefab;
 
     /// <summary>
     /// 停止移动的Buff特效.
     /// </summary>
-    public ParticleSystem bufStopMovePrefab;
+    public GameObject bufStopMovePrefab;
 
     protected bool zeroState = true;
 
@@ -53,10 +53,14 @@
     {
         if (id >= waveLineList.Count || waveLineList[id] == null) return;
 
-        ParticleSystem playParticle = Instantiate(skillFirePrefab);
-        playParticle.transform.position = EndlessLevelManager.instance.WaveManager.GetWaveEndPos(id);
-        playParticle.Play();
-        Destroy(playParticle.gameObject, playParticle.main.duration);
+        GameObject obj = Instantiate(skillFirePrefab);
+        ParticleSystem ps = obj.GetComponent<ParticleSystem>();
+
+        if (ps == null)
+            ps = obj.transform.GetChild(0).GetComponent<ParticleSystem>();
+        ps.transform.position = EndlessLevelManager.instance.WaveManager.GetWaveEndPos(id);
+        ps.Play();
+        Destroy(ps.gameObject, ps.main.duration);
     }
 
     /// <summary>
@@ -66,10 +70,15 @@
     public void PlayBattleAreaBombEffect(Vector3 pos)
     {
         if (skillBombPrefab == null) return;
-        ParticleSystem playParticle = Instantiate(skillBombPrefab);
-        playParticle.transform.position = pos;
-        playParticle.Play();
-        Destroy(playParticle.gameObject, playParticle.main.duration);
+
+        GameObject obj = Instantiate(skillBombPrefab);
+        ParticleSystem ps = obj.GetComponent<ParticleSystem>();
+
+        if (ps == null)
+            ps = obj.transform.GetChild(0).GetComponent<ParticleSystem>();
+        ps.transform.position = pos;
+        ps.Play();
+        Destroy(ps.gameObject, ps.main.duration);
     }
 
     /// <summary>
@@ -115,13 +124,7 @@
     {
         if (pos >= waveLineList.Count || waveLineList[pos] == null) return;
 
-        int subone = pos - 1;
-        int addone = pos + 1;
-
-        if (subone >= 0)
-            WaveLineFlash(subone);
+        // 无尽模式改为只有一条兵线
         WaveLineFlash(pos);
-        if (addone < waveLineList.Count)
-            WaveLineFlash(addone);
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1