Hopefully there is something similar. Thanks
Answer by SisterKy
Sep 13, 2011 at 10:54 AM
I think you are looking for this...?
uh, Unity (or Mono) adds features like those collections to JS? That is crazy, actually
I take that as crazy-in-a-good-way? ^^
indeed ;) but i wonder where this is documented (except for the collections)
Answer by meat5000
Dec 20, 2014 at 06:35 PM
Huh? What? I have no problem using lists in uJS. Is this a recent thing, then?
public var myList : List.<TYPE>; // Insert TYPE
See the date on the question? 2011. (Although I believe generics did work back then.)
Aye that's why I asked if Lists in uJS were recent :)
Anyhoo - Closing
Answer by timrox99
Feb 26, 2013 at 06:04 AM
This might help: http://www.w3schools.com/js/js_obj_array.asp
20/12/2014 - error 404 :(
Yeah, don't learn Unity coding from W3Schools JS. It's not what you need.
Answer by japanitrat
Sep 12, 2011 at 01:25 AM
If you are speaking of C# then "List" is not a function but a collection. In JS you can use Array which serves the same purpose (for instance you can push and pop elements dynamically), although it does provide the same amount possibilities.
Array is not really what I need. I need something that do the equivalence of List<MyClass>.
Edit: as pointed out by Ky, Unity or Mono do enhance the common JS stuff.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
6 People are following this question.
A node in a childnode?
Javascrip List unexpected token error
Spawning a list of objects with XML?
Can we make 2-D characters in unity using java script?