Exemplo n.º 1
0
 public void SetData(int ItemTypeID)
 {
     ClearUI();
     m_vInitPos   = MyHead.WndTweenParent.transform.localPosition;
     m_itemTypeID = ItemTypeID;
     ItemM.GetCombineEquipNeed(m_itemTypeID, ref m_composeEquipList, ref m_coin);
     SetUI();
 }
Exemplo n.º 2
0
    /// <summary>
    /// 炮弹兵装备格的状态
    /// </summary>
    /// <returns>The can put equip.</returns>
    /// <param name="info">Info.</param>
    /// <param name="EquipID">Equip I.</param>
    /// <param name="index">Index.</param>
    /// <param name="itemTypeID">Item type I.</param>
    public static EquipmentPutType CheckCanPutEquip(SoldierInfo info, int EquipID, int index, ref int itemTypeID)
    {
        itemTypeID = SoldierM.GetSoldierEquip(info.SoldierTypeID, info.Quality, index);

        if (EquipID == 0)
        {
            ItemTypeInfo ItemInfo = ItemDC.SearchItem(itemTypeID);
            if (ItemInfo != null)
            {
                if (info.Level >= ItemInfo.m_level)
                {
                    return(EquipmentPutType.CanPut);
                }
                else
                {
                    return(EquipmentPutType.HaveCannot);
                }
            }
            else
            {
                s_itemtypeInfo sInfo = ItemM.GetItemInfo(itemTypeID);

                List <KeyValue> needSubEquip = new List <KeyValue>();
                int             needCoin     = 0;
                bool            canCombine   = ItemM.GetCombineEquipNeed(itemTypeID, ref needSubEquip, ref needCoin);
                if (canCombine)
                {
                    if (ItemDC.CheckItemsEnough(needSubEquip))
                    {
                        if (needCoin < UserDC.GetCoin())
                        {
                            if (info.Level >= sInfo.level)
                            {
                                return(EquipmentPutType.CanCombinePut);
                            }
                            else
                            {
                                return(EquipmentPutType.CanCombine);
                            }
                        }
                        else
                        {
                            return(EquipmentPutType.CanCombine);
                        }
                    }
                    else if (!ItemDC.CheckItemsEnough(needSubEquip))
                    {
                        return(EquipmentPutType.ReadyCombine);
                    }
                    else
                    {
                        return(EquipmentPutType.None);
                    }
                }
                else
                {
                    return(EquipmentPutType.NoCanCombine);
                }
            }
        }
        else
        {
            return(EquipmentPutType.HavePut);
        }
    }