Saturday, November 1, 2014

Unity Arraylist Tutorial

So today I want to use arraylist in Unity but unable to find a simple guide, after doing all the testing with bit and piece from the internet I decided to write this simple and detail guide

Unity Javascript

var email_list : ArrayList ;


function Start () 
{

    email_list=new ArrayList();

}

//THEN YOU CAN ADD ITEM TO THE LIST AS BELOW

email_list.Add("haha");
email_list.Add("hoho");



//AFTERWARD YOU CAN RETRIEVE BACK THE ITEM AS BELOW

myvariable = email_list[1];


//TO CHECK THE SIZE OF ARRAYLIST AS BELOW

mysize = email_list.Count


//HOPE THAT HELP

No comments:

Post a Comment