// Use this for initialization void Start() { //StartCoroutine(LoadItemData()); for (int i = 0; i < items.Length - 1; i++) { inv.Add(CreateItem.CreateAndSplitItem(items[i])); //Debug.Log(inv[i].Name); } }
IEnumerator LoadItemData() { WWW itemsUrl = new WWW("localhost/unicorns_dee/Itemdata.php"); yield return(itemsUrl); string itemData = itemsUrl.text; //items = itemData.Split(';'); items = itemData.Split(';'); for (int i = 0; i < items.Length; i++) { inv.Add(CreateItem.CreateAndSplitItem(items[i])); Debug.Log(inv[i].Damage); } }