Beispiel #1
0
 void SetCurSelectMark(CarryShopItem item)
 {
     isShowSelectMark = true;
     selectMark.gameObject.SetActive(true);
     selectMark.parent        = item.transform;
     selectMark.localPosition = Vector3.zero;
 }
Beispiel #2
0
 //处理解锁
 void OnDealSendData(CarryShopItem item, EMessageCoinType coinType, int price, bool isUnLock)
 {
     if (!CarryShopModel.Instance.isJudgeMoneyEnough(coinType, price))
     {
         SoundManager.Instance.PlaySoundEffect("Sound_Button_Auction_Fail");
         if (coinType == EMessageCoinType.ECuType)
         {
             UI.MessageBox.Instance.ShowNotEnoughMoneyMsg(null);
         }
         else
         {
             UI.MessageBox.Instance.ShowNotEnoughGoldMoneyMsg();
         }
     }
     else
     {
         if (isUnLock)
         {
             SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_UnlockConfirm");
             NetServiceManager.Instance.TradeService.SendCarryShopUnLock_CS(PlayerManager.Instance.FindHeroDataModel().ActorID, item.shopUint.byIndex);
         }
         else
         {
             int pack = GetGoodsHavePacks((int)item.shopUint.dwShopID);
             if (pack > 0 && ContainerInfomanager.Instance.PackIsFull())
             {
                 UI.MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString("IDS_H2_2"), 1);                      // IDS_H2_2
                 return;
             }
             NpcPlayAnim("LadyAction07");
             SoundManager.Instance.PlaySoundEffect("Sound_UIEff_ShopLady");
             NetServiceManager.Instance.TradeService.SendCarryShopBuy_CS(item.shopUint.dwShopID, item.shopUint.byIndex, item.shopUint.dwShopNum);
         }
     }
 }
Beispiel #3
0
        public void OnSelectGoods(CarryShopItem item)
        {
            CarryShopModel.Instance.curSelectIndex = item.curIndex + CarryShopModel.Instance.curShowIndexView * 6;
            SetCurSelectMark(item);
            EMessageCoinType coinType = EMessageCoinType.EGoldType;
            int price = 0;

            if (item.shopData != null)
            {
                if (item.shopData.BuyType == 1)
                {
                    coinType = EMessageCoinType.ECuType;
                }
                else if (item.shopData.BuyType == 3)
                {
                    coinType = EMessageCoinType.EGoldType;
                }
            }
            if (item.isItemLock)
            {
                //弹出解锁//
                SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_UnlockWindow");
                price = CarryShopModel.Instance.GetUnLockPrice(item.shopUint.byIndex);
                UI.MessageBox.Instance.Show(3, coinType, LanguageTextManager.GetString("IDS_I29_3"), price,
                                            LanguageTextManager.GetString("IDS_H2_55"), LanguageTextManager.GetString("IDS_H2_28"),
                                            () => { OnDealSendData(item, coinType, price, true); }, () => {
                    //取消
                    SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_Cancel");
                });
            }
            else if (item.isItemOver)
            {
                //不动//
                SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_Unavailable");
            }
            else
            {
                //弹出购买//
                price = item.shopData.Price;
                SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_BuyWindow");
                UI.MessageBox.Instance.Show(3, coinType, string.Format(LanguageTextManager.GetString("IDS_I29_1"), LanguageTextManager.GetString(item.shopData.GoodsNameIds)),
                                            price, LanguageTextManager.GetString("IDS_H2_55"), LanguageTextManager.GetString("IDS_H2_28"),
                                            () => { OnDealSendData(item, coinType, price, false); }, () => {
                    //取消
                    SoundManager.Instance.PlaySoundEffect("Sound_Button_Shop_Cancel");
                });
            }
        }