Collections don't work!

Hi guys.

This one is driving me nuts! The only collection I can use is the regular Array. List, ArrayList etc. simply don’t work!

I get a “the name … does not exist in the current context.”

I have absolutely no idea what the problem is.

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class ScoreMgr : MonoBehaviour {

	public ArrayList myList;
        public List<int> myList2;

}

1 Answer

1

It needs to be:

public List<int> myList2 = new List<int>();