List bulletPools;
List AIPools;
void MakePools () {
for (int i = 0; i < game.bulletPools; i++) {
bulletPools.Add (new ObjectPool()); //NRE here
}
for (int i = 0; i < game.AIPools; i++) {
AIPools.Add (new ObjectPool());
}
}
The lists aren’t public and game
is tested and properly initialised; its pool values are both 100. The script uses System.Collections.Generic
. Built-in arrays have been tried to no more success. I tried initialising my new ObjectPool
into a variable on a separate line and adding that; no dice. I really don’t have the slightest idea just what it is that I’m doing wrong.