示例#1
0
 // 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);
     }
 }
示例#2
0
    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);
        }
    }