Ejemplo n.º 1
0
 public void Destroy()
 {
     if (pool == null)
     {
         foreach (EntityComponent component in components)
         {
             component.Destroyed();
         }
     }
     else
     {
         pool.Deposit(this);
     }
 }
Ejemplo n.º 2
0
 public void Destroy()
 {
     if (isAddedToGame)
     {
         RemoveFromGame();
     }
     if (pool == null || pool.IsDestroyed())
     {
         isDestroyed = true;
         foreach (EntityComponent component in components)
         {
             component.Destroyed();
         }
     }
     else
     {
         pool.Deposit(this);
     }
 }