I am making a Roulette game in Unity 5.0. I have a list in C# where I store the bets the player places. I use the following code to retrieve the bets placed by the user. Bets1 is the list which saves the type of bet placed by the user like SUP0 is straight up bet on Number 0, SPLT1 is split bet on number 1 & 2. These SUP0 and SPLT1 are lists in which these numbers are added.
for (int i = 0; i < Bets1.Count; i++)
{
string a = Bets1[i].listname;
Debug.Log(a);
//the output in console is SUP0 for Straight up bet on number 0
for (int j = 0; j < a.Count; j++)
{
Debug.Log(a[i]);
}
}
The above code shows error on a.Count and a[i]. My question is how to assign the value of variable a to be used as name of predefined list.