Example #1
0
    public void InitStoreItem(pd_StoreItem item)
    {
        switch (item.item_type)
        {
        case pe_StoreItemType.Item:
        case pe_StoreItemType.Stuff:
        case pe_StoreItemType.Rune:
        case pe_StoreItemType.Token:
            Clear();
            Info = ItemInfoManager.Instance.GetInfoByIdn(item.item_idn);
            InitIcon(true);
            break;

        case pe_StoreItemType.SoulStone:
            Clear();
            Info = ItemInfoManager.Instance.GetInfoByIdn(item.item_idn);
            InitSoulStoneInternal((Info as SoulStoneInfo), item.item_count);
            return;

        case pe_StoreItemType.Creature:
            m_RewardCreature = CreatureInfoManager.Instance.GetInfoByIdn(item.item_idn);
            InitCreature(m_RewardCreature, item.item_count);
            return;
        }
        m_count.text = item.item_count.ToString();
        m_count.gameObject.SetActive(true);
    }
Example #2
0
 public StoreConfirmParam(pd_StoreItem item, OnOkDeleage _del = null)
 {
     title      = Store.GetName(item);
     icon_id    = item.price.goods_type.ToString();
     price      = item.price.goods_value;
     message    = Localization.Get("StorePurchaseMessage");
     stuff_item = item;
     OnOk       = _del;
 }
Example #3
0
    static public string GetName(pd_StoreItem item)
    {
        if (item.item_type == pe_StoreItemType.SoulStone)
        {
            return(SoulStoneInfoManager.Instance.GetInfoByIdn(item.item_idn).Name);
        }

        if (item.item_type == pe_StoreItemType.Creature)
        {
            return(CreatureInfoManager.Instance.GetInfoByIdn(item.item_idn).Name);
        }

        return(ItemInfoManager.Instance.GetInfoByIdn(item.item_idn).Name);
    }
Example #4
0
    //---------------------------------------------------------------------------
    public void Init(string store_id, pd_StoreItem item)
    {
        m_StoreItem = item;
        m_StoreID   = store_id;

        gameObject.SetActive(true);

        m_ItemName.text = Store.GetName(item);

        RewardItem reward = NGUITools.AddChild(m_ItemIndicator, RewardItemPrefab).GetComponent <RewardItem>();

        reward.InitStoreItem(item);
        reward.OnClickItem = OnClickItem;

        m_Price.text           = Localization.Format("GoodsFormat", item.price.goods_value);
        m_PriceIcon.spriteName = item.price.goods_type.ToString();

        m_Purchased.SetActive(item.buying_state > 0);
    }
Example #5
0
    public void Add(pd_StoreItem data)
    {
        Item item = Items.Find(i => i.Info.IDN == data.item_idn);

        if (item == null)
        {
            item = new Item(ItemInfoManager.Instance.GetInfoByIdn(data.item_idn));
            if (item.IsItem)
            {
                Items.Insert(0, item);
            }
            else
            {
                Items.Add(item);
                CreatureManager.Instance.SetUpdateNotify();
            }
        }
        item.AddPiece(data.item_count);
        Save();
    }