private void OnDestroy() { foreach (var pe in gameObject.GetComponentsInChildren <KSPParticleEmitter>()) { EffectBehaviour.RemoveParticleEmitter(pe); } }
void OnDestroy() { if (pEmitter) { EffectBehaviour.RemoveParticleEmitter(pEmitter); } }
public static void Remove(PersistentKSPParticleEmitter pkpe) { EffectBehaviour.RemoveParticleEmitter(pkpe.pe); persistentEmitters.Remove(pkpe); //print("[SmokeScreen PersistentEmitterManager]: Removed 1 PersistentKSPParticleEmitter. Count = " + persistentEmitters.Count); }
public void OnDestroy() { foreach (KSPParticleEmitter emi in emission) { emi.emit = false; enablesmoke = false; EffectBehaviour.RemoveParticleEmitter(emi); } }
void OnDisable() { foreach (var pe in pEmitters) { if (pe != null) { pe.emit = false; EffectBehaviour.RemoveParticleEmitter(pe); } } }
void onDisable() { BDArmorySetup.numberOfParticleEmitters--; foreach (var pe in pEmitters) { if (pe != null) { pe.emit = false; EffectBehaviour.RemoveParticleEmitter(pe); } } }
private void OnDestroy() { foreach (var pe in gameObject.GetComponentsInChildren <KSPParticleEmitter>()) { EffectBehaviour.RemoveParticleEmitter(pe); } if (FlamingJoints.FlameObjects.Contains(gameObject)) { FlamingJoints.FlameObjects.Remove(gameObject); } }
void OnDisable() { foreach (var pe in pEmitters) { if (pe != null) { pe.emit = false; EffectBehaviour.RemoveParticleEmitter(pe); } } ExplosivePart = null; // Clear the Part reference. }
public void OnDestroy() { GameEvents.onLaunch.Remove(onLaunch); emitter = part.FindModelComponents <KSPParticleEmitter>(); if (emitter != null) { foreach (KSPParticleEmitter unit in emitter) { EffectBehaviour.RemoveParticleEmitter(unit); } } }
IEnumerator SelfDestructRoutine() { pEmitter.emit = false; EffectBehaviour.RemoveParticleEmitter(pEmitter); if (gpe) { gpe.emit = false; EffectBehaviour.RemoveParticleEmitter(gpe.pEmitter); } yield return(new WaitForSeconds(pEmitter.maxEnergy)); Destroy(gameObject); yield break; }
void onDisable() { BDArmorySetup.OnVolumeChange -= UpdateVolume; BDArmorySetup.numberOfParticleEmitters--; foreach (var pe in pEmitters) { if (pe != null) { pe.emit = false; EffectBehaviour.RemoveParticleEmitter(pe); } } sourceVesselName = null; }
private void OnSceneChange(GameScenes scene) { //Print("OnSceneChange"); for (int i = 0; i < persistentEmitters.Count; i++) { EffectBehaviour.RemoveParticleEmitter(persistentEmitters[i].pe); //Print(" go is " + persistentEmitters[i].go); //Destroy(persistentEmitters[i].go); if (persistentEmitters[i].go != null && persistentEmitters[i].go.transform.parent != null) { Destroy(persistentEmitters[i].go); } } persistentEmitters = new List <PersistentKSPParticleEmitter>(); }
void OnDisable() { foreach (var pe in pEmitters) { if (pe != null) { pe.emit = false; EffectBehaviour.RemoveParticleEmitter(pe); } } ExplosivePart = null; // Clear the Part reference. explosionEvents.Clear(); // Make sure we don't have any left over events leaking memory. explosionEventsPreProcessing.Clear(); explosionEventsPartsAdded.Clear(); explosionEventsBuildingAdded.Clear(); explosionEventsVesselsHitByMissiles.Clear(); }
void OnDisable() { foreach (var pe in gameObject.GetComponentsInChildren <KSPParticleEmitter>()) { if (pe == null) { continue; } EffectBehaviour.RemoveParticleEmitter(pe); if (!pe.useWorldSpace) { continue; } var gpe = pe.gameObject.GetComponent <DecalGaplessParticleEmitter>(); if (gpe != null) { gpe.Emit = false; } } }
public void Update() { if (Atmosphere >= 0.25) { LightFx.range -= 20 * Time.deltaTime; LightFx.intensity -= 1 * Time.deltaTime; } else { if (TimeIndex > 0.05) { LightFx.range -= 1300 * Time.deltaTime; LightFx.intensity = 0; } } if (TimeIndex > 0.2f && !emittersOff) { IEnumerator <KSPParticleEmitter> pe = PEmitters.AsEnumerable().GetEnumerator(); while (pe.MoveNext()) { if (pe.Current == null) { continue; } pe.Current.emit = false; EffectBehaviour.RemoveParticleEmitter(pe.Current); emittersOff = true; } pe.Dispose(); } else if (TimeIndex > LifeTime) { gameObject.SetActive(false); return; } }
public override void OnStart(PartModule.StartState state) { base.OnStart(state); { if (state != StartState.Editor && state != StartState.None) { this.enabled = true; this.part.force_activate(); } else { this.enabled = false; } if (base.part.FindModelTransform("rightrc") != null) { this.rightrcTransform = base.part.FindModelTransform("rightrc"); } if (base.part.FindModelTransform("leftrc") != null) { this.leftrcTransform = base.part.FindModelTransform("leftrc"); } if (base.part.FindModelTransform("rearrightrc") != null) { this.rearrightrcTransform = base.part.FindModelTransform("rearrightrc"); } if (base.part.FindModelTransform("rearleftrc") != null) { this.rearleftrcTransform = base.part.FindModelTransform("rearleftrc"); } if (deployAnimName != "") { deployStates = SetUpAnimation(deployAnimName, this.part); } if (hasDeployAnimation) { deployStates = SetUpAnimation(deployAnimName, this.part); foreach (AnimationState anim in deployStates) { anim.enabled = false; } } foreach (var emitter in part.FindModelComponents <KSPParticleEmitter>()) { emitter.emit = false; EffectBehaviour.RemoveParticleEmitter(emitter); } HoverEmitters = new List <KSPParticleEmitter>(); foreach (Transform htf in part.FindModelTransforms("HoverEmi")) { KSPParticleEmitter kpe = htf.GetComponent <KSPParticleEmitter>(); HoverEmitters.Add(kpe); kpe.emit = false; } } //CoMTransform.position = vessel.CoM; //CoMTransform.rotation = vessel.transform.rotation; //rightrcrelativePosition = CoMTransform.InverseTransformPoint(rightrcTransform.position); //leftrcrelativePosition = CoMTransform.InverseTransformPoint(leftrcTransform.position); //rearrightrcrelativePosition = CoMTransform.InverseTransformPoint(rearrightrcTransform.position); //rearleftrcrelativePosition = CoMTransform.InverseTransformPoint(rearleftrcTransform.position); //rightrcrelative = 1 / System.Math.Abs(rightrcrelativePosition.y); //leftrcrelative = 1 / System.Math.Abs(leftrcrelativePosition.y); //rearrightrcrelative = 1 / System.Math.Abs(rearrightrcrelativePosition.y); //rearleftrcrelative = 1 / System.Math.Abs(rearleftrcrelativePosition.y); }