Initializing four items into a List as follows, BUT it only initializes the first two items ... I really can't see what is wrong with this?
public List<SceneStore> lcRecordList = new List<SceneStore>
{
new SceneStore { description ="Jill ", ID = 1, visited = false },
new SceneStore { description = "Jack", ID = 2, visited = false},
new SceneStore { description = "Joe", ID = 3, visited = false},
new SceneStore { description = "Jenny", ID = 4, visited = false}
};
void NetTest()
{
NetworkService lcMyNetworkService = new NetworkService();
lcMyNetworkService.PutJsonList <SceneStore>(lcRecordList, "https://NewSimland.com/~todd/JSON", ReceiveAListOfRecords);
}
Took a screenshot
This adds four items just fine:
public List<SceneStore> lcRecordList;
void NetTest()
{
NetworkService lcMyNetworkService = new NetworkService();
lcRecordList = new List<SceneStore>
{
new SceneStore { description ="Jill ", ID = 1, visited = false },
new SceneStore { description = "Jack", ID = 2, visited = false},
new SceneStore { description = "Joe", ID = 3, visited = false},
new SceneStore { description = "Jenny", ID = 4, visited = false}
};
lcMyNetworkService.PutJsonList <SceneStore>(lcRecordList, "https://NewSimland.com/~todd/JSON", ReceiveAListOfRecords);
}
So why is initialization of lcRecordList on declaration limited to the first two?
Took another screenshot of the local variable value:


MonoBehaviour? If it is, then it means that the value that you see in the inspector will override the field initialization value.