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