A pooled enemy’s visibility is not the same as whether it exists in the simulation. Keep its state in logic data, separate from the GameObject used to display it. This lets saves, server-side checks, and balance tests use simulation data without relying on visuals. section 3.3.4
For enemies, EnemyData stores position, direction, velocity, and an Alive flag in arrays. Spawning finds an unused slot and marks it alive; removing an enemy clears that flag and deactivates its GameObject. When unpausing, reactivate only enemies marked alive. section 3.3.4
Listing 3.12 Our EnemyData class with the alive boolean array
public class EnemyData
{
public int NumEnemies;
public Vector2[] Position;
public Vector2[] Direction;
public float[] Velocity;
public bool[] Alive;
}EnemyData holds simulation values and alive state without storing the visual GameObject pool. section 3.3.4
