Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unknown identifier: 'List'.

Discussion in 'Scripting' started by renman3000, Apr 16, 2013.

  1. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    This...
    Code (csharp):
    1.  
    2. private var splinePoints = new List.<Vector2>();
    3.  
    Is giving me this...
    Error: Unknown identifier: 'List'.


    Why?
    I am using an Custom Asset (Vectrosity), specifically on this script. I had been running a test project with this asset, and it worked. I just switched it into my main project, copied a functioning script over and now, I get this.


    :?
     
  2. Kinos141

    Kinos141

    Joined:
    Jun 22, 2011
    Posts:
    969
    did you put
    Code (csharp):
    1.  
    2. using System.Collections.Generic;
    3.  
    that's how you get lists.
     
  3. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    Thank you.
     
  4. empo

    empo

    Joined:
    Apr 15, 2013
    Posts:
    12
    Ya, wish it would default to including that instead of System.Collections....
     
  5. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    You can change the script template if you wish
    ~~ Program Files ~~ \Unity\Editor\Data\Resources\ScriptTemplates
    You may need permissions (read only)
     
  6. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    And don't forget to backup your custom templates, the installer overwrites them every time you upgrade Unity.
     
  7. Alpacatron

    Alpacatron

    Joined:
    Apr 11, 2016
    Posts:
    2
    In javascript/unityscript that should be

    import System.Collections.Generic;

    i am right?