Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

something in "<test>"

Discussion in 'Scripting' started by RabenFutter, Jan 31, 2013.

  1. RabenFutter

    RabenFutter

    Joined:
    Dec 30, 2012
    Posts:
    38
    i already searched the internet for that statment but without knowing how this is called its i have to search tutorial sites manually.


    Code (csharp):
    1.  
    2. List< StoredData >
    3.  
    this is a public attribute from a class and i wanna know how i can acces it with java script. But it would not hurt to underestand this kind of statement, saw it a few times now.


    link to the surce
     
  2. BPPHarv

    BPPHarv

    Joined:
    Jun 9, 2012
    Posts:
    318
    This is called a generic function. Where StoredData is an arbitrary data type that you specify.

    The List part means that unlike an array, data elements do not follow one after the other. To find elements in the List one generally starts at the first element which has a reference to the next and continues searching elements till the one they want is the one that is being pointed to. This basically means that there's an additional overhead when accessing List items that arrays don't have but Lists, because elements are linked one to another have the ability to grow / shrink / delete at much less cost than you would encounter doing a similar operation to an array.

    Now to your question.. how to access this in unity's javascript.
    http://forum.unity3d.com/threads/153938-Class-list

    EDIT : My original comment calling this a generic function is incorrect. It would be more aptly be called a generic container class.
     
    Last edited: Jan 31, 2013
  3. RabenFutter

    RabenFutter

    Joined:
    Dec 30, 2012
    Posts:
    38
    thx for the good explanation, i feel smarter already :)

    edit: typo
     
    Last edited: Jan 31, 2013