| | |
| | | |
| | | if (woodChargeEffectTime <= 0 && woodChargeEffect != null) |
| | | { |
| | | towerPtr.IsWoodCharge = false; |
| | | CancelWoodAim(); |
| | | Destroy(woodChargeEffect); |
| | | woodChargeEffect = null; |
| | |
| | | if (woodAimAgent == null) |
| | | { |
| | | woodAimAgent = agent; |
| | | towerPtr.WoodAimAgent = agent; |
| | | |
| | | if (agent.WoodAimCount == 0) |
| | | agent.WoodAimEffect.Play(); |
| | | agent.PlayWoodAimEffect(); |
| | | |
| | | ++agent.WoodAimCount; |
| | | } |
| | |
| | | --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; |
| | | } |
| | |
| | | /// </summary> |
| | | private void CancelWoodAim() |
| | | { |
| | | if (woodAimAgent != null && woodAimAgent.WoodAimCount > 0) |
| | | if (woodAimAgent != null) |
| | | { |
| | | --woodAimAgent.WoodAimCount; |
| | | |
| | | if (woodAimAgent.WoodAimCount == 0) |
| | | if (woodAimAgent.WoodAimCount > 0) |
| | | { |
| | | woodAimAgent.WoodAimEffect.Stop(); |
| | | woodAimAgent.WoodAimEffect.Clear(); |
| | | --woodAimAgent.WoodAimCount; |
| | | |
| | | if (woodAimAgent.WoodAimCount == 0) |
| | | woodAimAgent.StopWoodAimEffect(); |
| | | } |
| | | } |
| | | |
| | |
| | | towerPtr.PlayEnergyEffect(true); |
| | | } |
| | | } |
| | | |
| | | // 如果在木属性蓄力期间,让瞄准动画播放 |
| | | if (towerPtr && towerPtr.IsWoodCharge && woodAimAgent != null) |
| | | woodAimAgent.PlayWoodAimEffect(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | protected virtual void Update() |
| | | { |
| | | if (m_Launcher == null) return; |
| | | if (m_Launcher == null || towerPtr != null && !towerPtr.CanAttack) return; |
| | | |
| | | // 处理当前Affector所在Tower对应的技能 |
| | | updateTowerSkillData(); |
| | |
| | | if (bnum - 1 >= 0 && bnum - 1 < critBulletNum) |
| | | { |
| | | woodRemainChargeTime = woodChargeTime; |
| | | towerPtr.IsWoodCharge = true; |
| | | DecreaseWoodChargeTime decreaseWoodChargeTime = (DecreaseWoodChargeTime)EndlessBuffManager.instance.GetBuffInstanceByType(EndlessBuffEffectType.DecreaseWoodChargeTime); |
| | | |
| | | if (decreaseWoodChargeTime != null) |
| | |
| | | |
| | | 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(); |