From 1ac26c01ffdc426d1e5db2950260e97c540ad1ed Mon Sep 17 00:00:00 2001 From: chenxin <chenxin6991@163.com> Date: Sat, 21 Nov 2020 16:07:33 +0800 Subject: [PATCH] 释放眩晕技能宝石,泡泡炸弹没有判断距离的bug --- Assets/Scripts/TowerDefense/Towers/WaveLineSelEffect.cs | 34 +++++++++++++++++++++++++++++++--- 1 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/TowerDefense/Towers/WaveLineSelEffect.cs b/Assets/Scripts/TowerDefense/Towers/WaveLineSelEffect.cs index 0ebecbd..d0f8e2e 100644 --- a/Assets/Scripts/TowerDefense/Towers/WaveLineSelEffect.cs +++ b/Assets/Scripts/TowerDefense/Towers/WaveLineSelEffect.cs @@ -1,4 +1,5 @@ using DG.Tweening; +using KTGMGemClient; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -14,10 +15,11 @@ /// 设置当前的WaveLine为选中状态 /// </summary> /// <param name="sel"></param> - public void SetWaveLineSel( bool sel) + public void SetWaveLineSel(bool sel) { - if( sel) + if (sel) { + //Debug.Log("技能启动特效"); setSelTime = 0.2f; if (!bInSel) mCurMat.DOColor(new Color(1.0f, 1.0f, 1.0f, 1.0f), 0.4f); @@ -25,10 +27,36 @@ } } + public ParticleSystem myPS;//可以升级的特效 + + public void SetParticleSystem(bool isOn) + { + if (isOn) + { + if (myPS.gameObject.activeSelf != isOn) myPS.gameObject.SetActive(isOn); + myPS.Play(); + } + else + { + myPS.Stop(); + if (myPS.gameObject.activeSelf != isOn) myPS.gameObject.SetActive(isOn); + } + } + // Start is called before the first frame update void Start() { mCurMat = this.GetComponent<MeshRenderer>().material; + myPS = transform.GetChild(0).GetChild(0).GetComponent<ParticleSystem>(); + EventCenter.Ins.Add<bool>((int)KTGMGemClient.EventType.EndlessStartDragSkill, EndlessStartDragSkill); + + } + + private void EndlessStartDragSkill(bool isOn) + { + if(!isOn){ + SetParticleSystem(isOn); + } } // Update is called once per frame @@ -36,7 +64,7 @@ { if (setSelTime <= 0) return; setSelTime -= Time.deltaTime; - if( setSelTime <= 0) + if (setSelTime <= 0) { bInSel = false; setSelTime = 0.0f; -- Gitblit v1.9.1