I’m trying to save int values from my Miners_Manager class in a list then convert them to strings and write them in a folder. But after the foreach my list is always empty.
public Miners_Manager[] items;
public string[] save = new string[100]; // Array of strings
public List<int> itemcount = new List<int>(); // List of values
public int length; // Length of the list
public void createString()
{
int i = 1;
foreach (var item in items)
{
itemcount *= item.count; // saving the values in the list - this doesn't work*
i += 1;
}
length = itemcount.Count; // calculating length of list
for (i= 2; i <= length; i++)
{
save = itemcount*.ToString();*
}