예제 #1
0
    void OpenItemDetail()
    {
        if (TSCData.Instance.ContainSkin(Id))
        {
            Debug.LogError("已经购买的了皮肤ID:" + Id.ToString());
        }
        else
        {
            EquipInfo info = InfoMgr <EquipInfo> .Instance.GetInfo(Id);

            UIManager.Instance.ShowWindow(WindowID.WindowID_Confirm);
            UIConfirm confirm = UIManager.Instance.GetGameWindowScript <UIConfirm>(WindowID.WindowID_Confirm);
            string    context = LanguageMgr.Instance.GetText(19, info.price.ToString(), LanguageMgr.Instance.GetText(info.nameId));
            confirm.SetTextContent(string.Empty, context);
            confirm.BindAction(BuySkin, null);
        }
    }
예제 #2
0
파일: UIBagItem.cs 프로젝트: k3498gg/TSC
    void OpenItemDetail()
    {
        if (TSCData.Instance.ContainSkin(Id))
        {
            EquipInfo info = InfoMgr <EquipInfo> .Instance.GetInfo(Id);

            if (null != info)
            {
                bool change = false;
                //int lastId = -1;
                //int lastFashionId = Util.GetFashionClothId(TSCData.Instance.Role.KeyTigerID, TSCData.Instance.Role.KeyStickID, TSCData.Instance.Role.KeyChickID);
                if (info.equipType + 1 == (int)ShopItemType.ShopItem_TIGER)
                {
                    if (TSCData.Instance.Role.KeyTigerID != Id)
                    {
                        //lastId = TSCData.Instance.Role.KeyTigerID;
                        TSCData.Instance.Role.KeyTigerID = Id;
                        change = true;
                    }
                }
                else if (info.equipType + 1 == (int)ShopItemType.ShopItem_STICK)
                {
                    if (TSCData.Instance.Role.KeyStickID != Id)
                    {
                        //lastId = TSCData.Instance.Role.KeyStickID;
                        TSCData.Instance.Role.KeyStickID = Id;
                        change = true;
                    }
                }
                else if (info.equipType + 1 == (int)ShopItemType.ShopItem_CHICK)
                {
                    if (TSCData.Instance.Role.KeyChickID != Id)
                    {
                        //lastId = TSCData.Instance.Role.KeyChickID;
                        TSCData.Instance.Role.KeyChickID = Id;
                        change = true;
                    }
                }
                else if (info.equipType + 1 == (int)ShopItemType.ShopItem_TAO)
                {
                    FashionInfo fasion = InfoMgr <FashionInfo> .Instance.GetInfo(info.id);

                    if (null != fasion)
                    {
                        if (TSCData.Instance.Role.KeyTigerID != fasion.tigerId)
                        {
                            TSCData.Instance.Role.KeyTigerID = fasion.tigerId;
                            if (!change)
                            {
                                change = true;
                            }
                        }

                        if (TSCData.Instance.Role.KeyStickID != fasion.stickId)
                        {
                            TSCData.Instance.Role.KeyStickID = fasion.stickId;
                            if (!change)
                            {
                                change = true;
                            }
                        }

                        if (TSCData.Instance.Role.KeyChickID != fasion.chickId)
                        {
                            TSCData.Instance.Role.KeyChickID = fasion.chickId;
                            if (!change)
                            {
                                change = true;
                            }
                        }
                    }
                }

                if (change)
                {
                    UIBagInfo bagInfo   = UIManager.Instance.GetGameWindowScript <UIBagInfo>(WindowID.WindowID_Bag);
                    int       fashionId = Util.GetFashionClothId(TSCData.Instance.Role.KeyTigerID, TSCData.Instance.Role.KeyStickID, TSCData.Instance.Role.KeyChickID);
                    bagInfo.Refresh(TSCData.Instance.Role.KeyTigerID, TSCData.Instance.Role.KeyStickID, TSCData.Instance.Role.KeyChickID, fashionId);
                }
            }
        }
        else
        {
            EquipInfo info = InfoMgr <EquipInfo> .Instance.GetInfo(Id);

            UIManager.Instance.ShowWindow(WindowID.WindowID_Confirm);
            UIConfirm confirm = UIManager.Instance.GetGameWindowScript <UIConfirm>(WindowID.WindowID_Confirm);
            string    context = LanguageMgr.Instance.GetText(19, info.price.ToString(), LanguageMgr.Instance.GetText(info.nameId));
            confirm.SetTextContent(string.Empty, context);
            confirm.BindAction(BuySkin, null);
        }
    }