import System.Collections.Generic;
var boxColliderList : List.<Collider>=new List.<Collider>();
i get this error:
Unexpected Token: …
i wanted to start using lists instead of arrays but no luck… it seems that most simplest thing is not working, like declaring a list…i am using unityscript as you can see…
Put this C# script in Standard Assets and call it ListX:
using UnityEngine;
using System.Collections.Generic;
public class ListX {
public static List<Collider> ColliderList () {
return new List<Collider>();
}
}
Then in JS you can do this:
function Start () {
var boxColliderList = new ListX.ColliderList();
boxColliderList.Add (collider);
Debug.Log (boxColliderList.Count + " " + typeof(boxColliderList));
}
If you need other kind of Lists you can add appropriate functions to ListX.