public void PowerDownShieldEffect(Entity building) { ShieldBuildingInfo shieldBuildingInfo = this.GetShieldBuildingInfo(building, ShieldLoadReason.PowerDownShieldEffect, null); if (shieldBuildingInfo == null) { return; } shieldBuildingInfo.PlayShieldDisolveEffect(true, new DissolveCompleteDelegate(this.PowerDownShieldEffectComplete)); }
public void PlayDestructionEffect(Entity building) { ShieldBuildingInfo shieldBuildingInfo = this.GetShieldBuildingInfo(building, ShieldLoadReason.PlayDestructionEffect, null); if (shieldBuildingInfo == null) { return; } shieldBuildingInfo.PlayShieldDisolveEffect(false, new DissolveCompleteDelegate(this.PowerDownShieldEffectComplete)); if (shieldBuildingInfo.DecalMaterial != null) { new ShieldDecal(shieldBuildingInfo.DecalMaterial, false); } }
private void PlayEffect(Entity building, bool idle, float delay) { if (delay > 0f) { if (!this.delayTimers.ContainsKey(building)) { uint value = Service.ViewTimerManager.CreateViewTimer(delay, false, new TimerDelegate(this.PlayDelayedEffect), building); this.delayTimers.Add(building, value); } return; } ShieldBuildingInfo shieldBuildingInfo = this.GetShieldBuildingInfo(building, ShieldLoadReason.PlayEffect, idle); if (shieldBuildingInfo == null) { return; } if (shieldBuildingInfo.Generator != null) { shieldBuildingInfo.Generator.SetActive(true); } if (shieldBuildingInfo.Top != null) { shieldBuildingInfo.Top.SetActive(true); } if (shieldBuildingInfo.Shield != null) { shieldBuildingInfo.Shield.transform.parent.gameObject.SetActive(true); } shieldBuildingInfo.PlayShieldDisolveEffect(true, new DissolveCompleteDelegate(this.DestroyDissolver)); if (shieldBuildingInfo.DecalMaterial != null) { new ShieldDecal(shieldBuildingInfo.DecalMaterial, true); } if (!idle && shieldBuildingInfo.Spark != null) { ParticleSystem spark = shieldBuildingInfo.Spark; spark.transform.root.gameObject.SetActive(true); spark.Play(); } if (!idle) { Service.EventManager.SendEvent(EventId.ShieldStarted, building); } }