Exemplo n.º 1
0
    public void Create(StaticShopVo staticShopVo)
    {
        this.staticShopVo = staticShopVo;
        switch (staticShopVo.type)
        {
        case 1:
            StaticItemVo staticItemVo = StaticDataPool.Instance.staticItemPool.GetStaticDataVo(staticShopVo.itemId);
            icon.sprite   = ResourceManager.Instance.GetItemIcon(staticItemVo.icon);
            itemName.text = staticItemVo.name;
            desc.text     = staticItemVo.desc;
            break;

        case 2:
            StaticEquipVo staticEquipVo = StaticDataPool.Instance.staticEquipPool.GetStaticDataVo(staticShopVo.itemId);
            icon.sprite   = ResourceManager.Instance.GetEquipIcon(staticEquipVo.icon);
            itemName.text = staticEquipVo.equipName;
            desc.text     = staticEquipVo.desc;
            break;

        case 3:
            StaticUnitVo staticUnitVo = StaticDataPool.Instance.staticUnitPool.GetStaticDataVo(staticShopVo.itemId);
            icon.sprite   = ResourceManager.Instance.GetCharactorIcon(staticUnitVo.icon);
            itemName.text = staticUnitVo.name;
            desc.text     = staticUnitVo.desc;
            break;
        }
        if (staticShopVo.priceType == 1)
        {
            price.text = "灵魂:" + staticShopVo.price;
        }
        else if (staticShopVo.priceType == 2)
        {
            price.text = "金币:" + staticShopVo.price;
        }
    }
Exemplo n.º 2
0
 public void AddData(string[] lineArray)
 {
     for (int i = 1; i < lineArray.Length; i++)
     {
         lineArray[i] = lineArray[i].Replace("\r", "");
         string[]     strArray = lineArray[i].Split(","[0]);
         StaticShopVo vo       = new StaticShopVo(strArray);
         _datapool.Add(vo);
     }
 }