I am having a problem reading all the list using for loop with duplicate data inside the list.
This is my code:
List<string> MyList= new List<string>();
void Start () {
MyList.Add("SampTable");
MyList.Add("Respawn");
MyList.Add("SampTable");
}
public void ReadList()
{
int TagNum = MyList.Count;
for(int i = 0; i < TagNum; i++)
{
Debug.Log(TagNum);
Debug.Log(MyList*);*
}
}
However the output is always
3
SampTable
Respawn
I want the output like
3
SampTable
Respawn
SampTable