| | |
| | | /// <summary> |
| | | /// 木属性精灵蓄力特效 |
| | | /// </summary> |
| | | public GameObject WoodChargeEffect; |
| | | |
| | | private GameObject woodChargeEffect; |
| | | public ParticleSystem WoodChargeEffect; |
| | | |
| | | public Transform WoodChargeTransform; |
| | | |
| | |
| | | woodChargeEffectTime -= Time.deltaTime; |
| | | UpdateWoodAim(); |
| | | |
| | | if (woodChargeEffectTime <= 0 && woodChargeEffect != null) |
| | | if (woodChargeEffectTime <= 0) |
| | | { |
| | | towerPtr.IsWoodCharge = false; |
| | | CancelWoodAim(); |
| | | Destroy(woodChargeEffect); |
| | | woodChargeEffect = null; |
| | | WoodChargeEffect.Stop(); |
| | | } |
| | | } |
| | | |
| | |
| | | woodRemainChargeTime = decreaseWoodChargeTime.GetWoodChargeTime(woodChargeTime); |
| | | |
| | | 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(); |
| | | WoodChargeEffect.Play(); |
| | | } |
| | | } |
| | | else |