Quantcast
Viewing all articles
Browse latest Browse all 78

2-dimensional array in JS

Could anyone help me with 2d arrays? Because I would like to store my item info loaded from an online database in a 2d array like: //Item with ID #0 item[0,0] = "Chain Helmet"; //Name item[0,1] = 10; //Sell price item[0,2] = "ChainHelmet1"; //Prefab //Item with ID #1 item[1,0] = "Plate Chest"; //Name item[1,1] = 20; //Sell price item[1,2] = "PlateChest1"; //Prefab Would be nice if the array can hold floats/ints as well as strings (like above example)... I come from GameMaker Studio engine, so don't know if this is possible in Unity. The script reference about arrays is also hard to understand. Also don't know how to declare such an array... Hope you can help me with this one :D

Viewing all articles
Browse latest Browse all 78

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>