Ejemplo n.º 1
0
    }//读取文本类型数据,并管理成字典和数组

    void ReadInventotyItemInfo()
    {
        //TOTO需要从服务器上得到信息 更新

        //随机生成主角拥用的物品

        /*
         * ....
         */

        inventoryItemDbController.GetInventoryItemDB();
    }//完成角色背包信息的初始化,和角色随机拥有的物品
Ejemplo n.º 2
0
 //完成角色背包信息的初始化,获得拥有的物品
 void ReadInventoryItemInfo()
 {
     //随机生成主角拥有的物品
     //for (int j = 0; j < 20;j++ ) {
     //    int id = Random.Range(1001, 1020);
     //    Inventory i = null;
     //    inventoryDict.TryGetValue(id, out i);
     //    if (i.InventoryTYPE == InventoryType.Equip) {
     //        InventoryItem it = new InventoryItem();
     //        it.Inventory = i;
     //        it.Level = Random.Range(1, 10);
     //        it.Count = 1;
     //        inventoryItemList.Add( it);
     //    } else {
     //        //先判断背包里面是否已经存在
     //        InventoryItem it = null;
     //        bool isExit = false;
     //        foreach (InventoryItem temp in inventoryItemList) {
     //            if (temp.Inventory.ID == id) {
     //                isExit = true;
     //                it = temp;
     //                break;
     //            }
     //        }
     //        if (isExit) {
     //            it.Count++;
     //        } else {
     //            it = new InventoryItem();
     //            it.Inventory = i;
     //            it.Count = 1;
     //            inventoryItemList.Add( it);
     //        }
     //    }
     //}
     inventoryItemDBController.GetInventoryItemDB();
 }