With the help of info here I created a random unique number generator in an arraylist.
I want to print the arraylist content to my console but I only get this message: System.Collections.ArrayList
If I use .Count or .IndexOf it works.
I can’t find a solution anywhere on the internet. And Unity doesn’t support arraylist in their documentation at all.
Thanks!
My code:
var totalHumans:int = 8;
var aHuman = ArrayList();
function Start ()
{
while (aHuman.Count < totalHumans)
{
var human = Random.Range(0, 17);
if (!aHuman.Contains(human))
aHuman.Add(human);
}
Debug.Log(aHuman);
}