I was under the impression this would populate my list with instances (or references to) of my second class but when run I just get a list filled with none
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DataStructure : MonoBehaviour
{
public int size;
public List<DataEntry> dataList = new List<DataEntry>();
void Start()
{
for (int x = 0; x < size; x++)
{
DataEntry newEntry = new DataEntry();
dataList.Add(newEntry);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DataEntry : MonoBehaviour
{
public string text;
public int number;
}