I have this code
public List<List<decimal>> connection = new List<List<decimal>>();
Calling connection.Count() give error NullReferenceException , why ? i already initialize it with empty list ?
Here is the full code , pretty straightforward
public List<Neuron> neuron = new List<Neuron>(new Neuron[480501]);
void LateUpdate()
{
Debug.Log("nc : " + neuron[0]); // runs fine
Debug.Log("nc : " + neuron[0].connection); //error
}
public class Neuron
{
public List<List<decimal>> connection = new List<List<decimal>>();
}