From bac1e673b54b1e5f773c4bd098e1b4fe8981c62e Mon Sep 17 00:00:00 2001 From: wangguan <wangguan@kt007.com> Date: Tue, 27 Oct 2020 20:39:17 +0800 Subject: [PATCH] Merge branch 'master' of ssh://172.16.1.52:8091/GemBattle --- Assets/Scripts/TowerDefense/Level/EndlessWaveLineManager.cs | 31 ++++++++++++++++++++----------- 1 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Assets/Scripts/TowerDefense/Level/EndlessWaveLineManager.cs b/Assets/Scripts/TowerDefense/Level/EndlessWaveLineManager.cs index a91a3a6..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> -- Gitblit v1.9.1