Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

List class

Discussion in 'Scripting' started by Richard_B, Aug 21, 2005.

  1. Richard_B

    Richard_B

    Joined:
    Jul 22, 2005
    Posts:
    436
    I am trying to use the "List" class, but keep getting an error "error CS1002: Expecting `;'". Example code is:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using System.Collections.Generic;  
    5.  
    6.  
    7. public class NewBehaviourScript : MonoBehaviour {
    8.  
    9.   void Awake () {
    10.        List<int> intList = new List<int>();
    11.    }
    12. }
    13.  
    Any clues as to what I am doing wrong?

    many thanks,
    Richard.
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    4,880
    Generics aren't supported yet.
    Use the non-generic versions instead eg. ArrayList
     
unityunity