public override void Unload() { try { if (m_soundEmitter != null && m_soundEmitter.IsPlaying) { m_soundEmitter.StopSound(true); } if (m_light != null) { m_light.GlareOn = false; m_light.LightOn = false; m_light.ReflectorOn = false; m_light.UpdateLight(); MyLights.RemoveLight(m_light); } } catch (Exception e) { Logging.Instance.WriteLine($"CheckGridGroup() Error: {e.ToString()}"); } }
public void CleanLights() { if (m_light != null) { MyLights.RemoveLight(m_light); m_light = null; } if (m_leftGlare != null) { MyLights.RemoveLight(m_leftGlare); m_leftGlare = null; } if (m_rightGlare != null) { MyLights.RemoveLight(m_rightGlare); m_rightGlare = null; } foreach (var thrust in m_jetpackThrusts) { MyLights.RemoveLight(thrust.Light); } m_jetpackThrusts.Clear(); }
// Kills this missile. Must be called at her end (after explosion or timeout) // This method must be called when this object dies or is removed // E.g. it removes lights, sounds, etc public override void Close() { UpdateTarget(null); base.Close(); this.Physics.Clear(); MyMissiles.Remove(this); if (m_collidedEntity != null) { m_collidedEntity.OnClose -= m_collidedEntity_OnClose; m_collidedEntity = null; } if (m_smokeEffect != null) { m_smokeEffect.Stop(); m_smokeEffect = null; } // Free the light if (m_light != null) { MyLights.RemoveLight(m_light); m_light = null; } // Stop thruster cue if ((m_thrusterCue != null) && (m_thrusterCue.Value.IsPlaying == true)) { m_thrusterCue.Value.Stop(SharpDX.XACT3.StopFlags.Immediate); } m_thrusterCue = null; }
public override void Close() { if (block == null) { return; } // Unhook from events. block.IsWorkingChanged -= IsWorkingChanged; block.PropertiesChanged -= PropertiesChanged; if (EXPERIMENTAL) { if (_light != null) { MyLights.RemoveLight(_light); _light = null; } if (_lightInner != null) { MyLights.RemoveLight(_lightInner); _lightInner = null; } if (_lightOuter != null) { MyLights.RemoveLight(_lightOuter); _lightOuter = null; } } block = null; subpart = null; NeedsUpdate = MyEntityUpdateEnum.NONE; }
protected override void Closing() { MyLights.RemoveLight(m_light); base.Closing(); }
protected override void Closing() { // m_thrustComponent.Unregister(this, ThrustForwardVector); MyLights.RemoveLight(m_light); base.Closing(); }
public override void Close() { MyLights.RemoveLight(m_pointLight); m_pointLight = null; base.Close(); }
public void Close() { MyLights.RemoveLight(Light); }