chenxin
2020-11-25 56f409504f41dc514a75f39995d11f86aec07e34
Assets/Scripts/TowerDefense/Affectors/AttackAffector.cs
@@ -346,6 +346,7 @@
                if (woodChargeEffectTime <= 0 && woodChargeEffect != null)
                {
                    towerPtr.IsWoodCharge = false;
                    CancelWoodAim();
                    Destroy(woodChargeEffect);
                    woodChargeEffect = null;
@@ -383,9 +384,10 @@
                if (woodAimAgent == null)
                {
                    woodAimAgent = agent;
                    towerPtr.WoodAimAgent = agent;
                    if (agent.WoodAimCount == 0)
                        agent.WoodAimEffect.Play();
                        agent.PlayWoodAimEffect();
                    ++agent.WoodAimCount;
                }
@@ -397,14 +399,14 @@
                        --woodAimAgent.WoodAimCount;
                        if (woodAimAgent.WoodAimCount == 0)
                        {
                            woodAimAgent.WoodAimEffect.Stop();
                            woodAimAgent.WoodAimEffect.Clear();
                        }
                            woodAimAgent.StopWoodAimEffect();
                    }
                    woodAimAgent = agent;
                    towerPtr.WoodAimAgent = agent;
                    if (agent.WoodAimCount == 0)
                        agent.WoodAimEffect.Play();
                        agent.PlayWoodAimEffect();
                    ++agent.WoodAimCount;
                }
@@ -449,10 +451,7 @@
                --woodAimAgent.WoodAimCount;
                if (woodAimAgent.WoodAimCount == 0)
                {
                    woodAimAgent.WoodAimEffect.Stop();
                    woodAimAgent.WoodAimEffect.Clear();
                }
                    woodAimAgent.StopWoodAimEffect();
            }
            woodAimAgent = null;
@@ -694,6 +693,7 @@
                if (bnum - 1 >= 0 && bnum - 1 < critBulletNum)
                {
                    woodRemainChargeTime = woodChargeTime;
                    towerPtr.IsWoodCharge = true;
                    DecreaseWoodChargeTime decreaseWoodChargeTime = (DecreaseWoodChargeTime)EndlessBuffManager.instance.GetBuffInstanceByType(EndlessBuffEffectType.DecreaseWoodChargeTime);
                    if (decreaseWoodChargeTime != null)
@@ -701,6 +701,7 @@
                    woodChargeEffectTime = woodRemainChargeTime + 0.5f / towerLevel.ActionAnimator.speed;
                    woodChargeEffect = Instantiate(WoodChargeEffect);
                    woodChargeEffect.transform.SetParent(gameObject.transform);
                    woodChargeEffect.transform.SetPositionAndRotation(WoodChargeTransform.position, WoodChargeTransform.rotation);
                    ParticleSystem ps = woodChargeEffect.transform.GetChild(0).GetComponent<ParticleSystem>();
                    ps.Play();