Beispiel #1
0
 public void Generate()
 {
     if (generated)
     {
         Internal.Destroy();
         PrimaryEditor.Lights.Remove(Internal);
     }
     generated = true;
     Internal  = new PointLight(Position, texturesize, Radius, Color);
     PrimaryEditor.Lights.Add(Internal);
 }
Beispiel #2
0
 /// <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!");
     }
 }
Beispiel #3
0
 public override void DestroyBody()
 {
     TheClient.MainWorldView.Lights.Remove(light);
     light.Destroy();
     base.DestroyBody();
 }