Hi everybody,
I’m working on a js script, and I want to know how to read elements of a [ ]. Here is my code
var guiSkin : GUISkin;
var money : int;
var moneyName : String;
class Item extends System.Object {
var itemName : String;
var itemCost : int;
var description : String;
var itemType : String;
public var hasItem : boolean;
}
public var Items : Item[];
function Start () {
}
function Update () {
}
For example if I write (on the editor), an Item element with itemName = Apple; itemCost = 2; description = “Apple”; itemType = “food”; I want that this script or others scripts read this elements and create a GUI button (to buy that) So here, a gui button with as title “Apple”, and when I click, the description and a buy button spawn ect… It’s possible ?
Thanks for advance.