public void Generate() { if (generated) { Internal.Destroy(); PrimaryEditor.Lights.Remove(Internal); } generated = true; Internal = new PointLight(Position, texturesize, Radius, Color); PrimaryEditor.Lights.Add(Internal); }
/// <summary> /// Fired when the entity is despawned. /// </summary> public override void OnDespawn() { if (Entity.Engine is GameEngine3D eng) { eng.MainView.Lights.Remove(InternalLight); InternalLight.Destroy(); InternalLight = null; Entity.OnPositionChanged -= FixPosition; } else { SysConsole.Output(OutputType.WARNING, "3D light despawned from a non-3D-engine-based game!"); } }
public override void DestroyBody() { TheClient.MainWorldView.Lights.Remove(light); light.Destroy(); base.DestroyBody(); }