Esempio n. 1
0
 void BuyRequest()
 {
     SecretShopMgr.GetInstance()._UIDragonMallCell = this;
     if (_type == ShopItemType.Active)
     {
         SecretShopMgr.GetInstance().SetSecretShopTag(true, mActivedata, _type, 2);
     }
     else
     {
         SecretShopMgr.GetInstance().SetSecretShopTag(true, mdata, _type, 2);
     }
 }
Esempio n. 2
0
    public void Buy_OnClick()
    {
        if (Shop_Index == 2)
        {
            BuyNormal_OnClick();
        }
        else
        {
            SecretShopMgr.GetInstance().SecretShopBuyRequest();
        }

        gameObject.SetActive(false);
    }
Esempio n. 3
0
    void OnClick()
    {
        SecretShopMgr.GetInstance().ClearAllChoose();
        SecretShopMgr.GetInstance()._UISecretShopCell = this;
        SecretShopMgr.GetInstance().SetSecretShopTag(true, SecretShopType.SecretShopType_Buy, _BuyStatus, mdata, 1);
        mChoose.gameObject.SetActive(true);
        //add by wxl
//		if(_data != null){
//			string tName = _data.name.ToString ();
//			ControllerEventData ctrl = new ControllerEventData (tName, "UISecretShopCell");
//			ActivityNetController.GetInstance ().SendCurrentUserState (ctrl);
//		}
    }
Esempio n. 4
0
    public void Back_OnClick()
    {
        VipList.Clear();
        LvList.Clear();
        NormalList.Clear();
        allList.Clear();
        SoulHeroList.Clear();

        SecretShopMgr.GetInstance().m_data = null;
        SecretShopMgr.GetInstance().CloseSecretTime();
        SecretShopMgr.GetInstance().Clear();

        Destroy(gameObject);
        //gameObject.SetActive(false);
        DBUIController.mDBUIInstance.ShowFor2D_UI();
    }
Esempio n. 5
0
 void Start()
 {
     _SoulRewardPanel.gameObject.SetActive(false);
     if (SecretShopMgr.GetInstance()._ShopType == 1)
     {
         shopone.gameObject.SetActive(true);
         shoptwo.gameObject.SetActive(false);
         Zejuan.gameObject.SetActive(false);
     }
     else
     {
         shopone.gameObject.SetActive(false);
         shoptwo.gameObject.SetActive(true);
         Zejuan.gameObject.SetActive(true);
         foreach (UISecretSoulHero script in SoulHeroList)
         {
             script.gameObject.SetActive(false);
         }
     }
 }
Esempio n. 6
0
 //初始化 item
 public void InitItem()
 {
     UnityEngine.Object obj = WXLLoadPrefab.GetPrefab(WXLPrefabsName.UISecretShopCellItem);
     if (obj != null)
     {
         GameObject       go      = Instantiate(obj) as GameObject;
         UISecretShopCell fc      = go.GetComponent <UISecretShopCell> ();
         Transform        goTrans = go.transform;
         if (SecretShopMgr.GetInstance()._ShopType == 2)
         {
             go.transform.parent = itemRoot.transform;
         }
         else
         {
             go.transform.parent = itemRootBaBa.transform;
         }
         goTrans.localScale         = Vector3.one;
         go.transform.localPosition = Vector3.zero;
         UISecretShopCellList.Add(fc);
         //   fc.Init(id);
         //return fc;
     }
 }
Esempio n. 7
0
 public void RefreshRequest()
 {
     Debug.Log(" refresh =" + SecretShopMgr.GetInstance()._ShopType);
     if (SecretShopMgr.GetInstance()._ShopType != 0)
     {
         if (costMoneyType == 0)
         {
             if (Core.Data.playerManager.RTData.curStone < costMoney)
             {
                 SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(35006));
                 return;
             }
         }
         else if (costMoneyType == 1)
         {
             if (Core.Data.playerManager.RTData.curCoin < costMoney)
             {
                 SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(35000));
                 return;
             }
         }
         SecretShopMgr.GetInstance().RefreshSecretShop();
     }
 }
Esempio n. 8
0
    public void ClickBuild()
    {
        if (Core.Data.playerManager.RTData.curLevel < m_buildData.config.limitLevel && m_buildData.config.limitLevel >= 0)
        {
            string strText = Core.Data.stringManager.getString(6054);
            strText = strText.Replace("#", m_buildData.config.limitLevel.ToString());
            SQYAlertViewMove.CreateAlertViewMove(strText);
            return;
        }

        if (m_buildData.config.build_kind == BaseBuildingData.BUILD_KIND_PRODUCE)
        {
            if (m_buildData.RTData.openType != 0 && m_buildData.RTData.robc > 0 && !m_bRobTipOpened)
            {
                ShowRobUI();
                return;
            }
        }

        if (m_buildData.config.id == BaseBuildingData.BUILD_ZHAOMU)
        {
            if (Core.Data.BuildingManager.ZhaoMuUnlock)
            {
                ZhaoMuUI.OpenUI();
                DBUIController.mDBUIInstance.HiddenFor3D_UI();
            }
            else
            {
                string strText = Core.Data.stringManager.getString(9111);
                strText = string.Format(strText, RED.GetChineseNum(4));
                SQYAlertViewMove.CreateAlertViewMove(strText);
            }
        }
        else if (m_buildData.config.id == BaseBuildingData.BUILD_XUNLIAN)
        {
            TrainingRoomUI.OpenUI();
            DBUIController.mDBUIInstance.HiddenFor3D_UI();
        }
        else if (m_buildData.config.id == BaseBuildingData.BUILD_YELIAN)
        {
            FrogingSystem.ForgingRoomUI.OpenUI();
            DBUIController.mDBUIInstance.HiddenFor3D_UI();
        }
        else if (m_buildData.config.id == BaseBuildingData.BUILD_TREE)
        {
            string strText = Core.Data.stringManager.getString(5116);
            SQYAlertViewMove.CreateAlertViewMove(strText);
            return;
        }
        else if (m_buildData.config.id == BaseBuildingData.BUILD_SHOP)
        {
            SecretShopMgr.GetInstance().SetSecretShop(true, 1);
            DBUIController.mDBUIInstance.HiddenFor3D_UI();
        }
        else if (m_buildData.config.id == BaseBuildingData.Q_phD)
        {
            SecretShopMgr.GetInstance().SetSecretShop(true, 2);
            DBUIController.mDBUIInstance.HiddenFor3D_UI();
        }
        else if (m_buildData.config.id == BaseBuildingData.BUILD_MailBox)
        {
            MailBox.OpenUI(1);
            DBUIController.mDBUIInstance.HiddenFor3D_UI();
        }
        else if (m_buildData.config.id == BaseBuildingData.BUILD_FUBEN)
        {
            DBUIController.mDBUIInstance.OnBtnMainViewID(SQYMainController.CLICK_FuBen);
        }
        else if (m_buildData.config.id == BaseBuildingData.BUILD_CHALLENGE)
        {
            DBUIController.mDBUIInstance.OnBtnMainViewID(SQYMainController.CLICK_DuoBao);
        }
        else if (m_buildData.config.id == BaseBuildingData.BUILD_FRAGMENT)
        {
            DBUIController.mDBUIInstance.SetViewState(RUIType.EMViewState.S_Bag, RUIType.EMBoxType.LOOK_MonFrag);
        }
        else if (m_buildData.config.build_kind == BaseBuildingData.BUILD_KIND_PRODUCE)
        {
            Debug.Log("  build_kind  " + m_buildData.config.build_kind);
            UISourceBuilding.OpenUI(m_buildData);
        }
        else
        {
            BuildingLvUpNew.OpenUI(m_buildData);
            //BuildLvlUpUI.OpenUI(m_buildData);
        }
    }
    public static void CreatActivity(ActivityItemType type, object objPos, System.Action callback = null)
    {
        //	AbsActivity AbsA= null;
        switch (type)
        {
        case ActivityItemType.festivalItem:
            if (_ActFestivalCtrl == null)
            {
                _ActFestivalCtrl = WXLActivityFestivalController.CreateFestivalPanel(ActivityItemType.festivalItem, (GameObject)objPos);
            }
            else
            {
                _ActFestivalCtrl.gameObject.SetActive(true);
            }

            //	ActivityNetController.GetInstance().SendLoginFestival ();
            break;

        case  ActivityItemType.mosterComeItem:
            if (_ActMonsterCtrl == null)
            {
                _ActMonsterCtrl = UIActMonsterComeController.CreateMonsterPanel(ActivityItemType.mosterComeItem, (GameObject)objPos);
            }
            else
            {
                _ActMonsterCtrl.gameObject.SetActive(true);
            }
            break;

        case ActivityItemType.taobaoItem:
            if (_ActTaoBaoCtrl == null)
            {
                _ActTaoBaoCtrl = UITaoBaoController.CreateTaoBaoPanel(ActivityItemType.taobaoItem, (GameObject)objPos);
            }
            else
            {
                _ActTaoBaoCtrl.gameObject.SetActive(true);
            }
            break;

        case ActivityItemType.dinnerItem:
            if (_ActDinnerCtrl == null)
            {
                _ActDinnerCtrl = ActDinnerController.CreateDinnerPanel(ActivityItemType.dinnerItem, (GameObject)objPos);
            }
            else
            {
                _ActDinnerCtrl.gameObject.SetActive(true);
            }
            break;

        case ActivityItemType.qiandaoItem:
            if (_ActDateSignCtrl == null)
            {
                _ActDateSignCtrl = UIDateSignController.CreateUIdateSignPanel(ActivityItemType.qiandaoItem, (GameObject)objPos);
            }
            else
            {
                _ActDateSignCtrl.gameObject.SetActive(true);
            }
            break;

        case ActivityItemType.levelRewardItem:
            if (_ActLevelRewardCtrl == null)
            {
                _ActLevelRewardCtrl = UILevelRewardController.CreateUILevelRewardPanel(ActivityItemType.levelRewardItem, (GameObject)objPos, callback);
            }
            else
            {
                _ActLevelRewardCtrl.gameObject.SetActive(true);
            }
            break;

        case ActivityItemType.gonggaoItem:
            AnnounceMrg.GetInstance().SetInfoPanel(true);
            break;

        case ActivityItemType.secretShopItem:
            SecretShopMgr.GetInstance().SetSecretShop(true, 1);
            DBUIController.mDBUIInstance.HiddenFor3D_UI();
            break;

        case ActivityItemType.vipEnter:
            UIDragonMallMgr.GetInstance().SetVipLibao();
            break;

        case ActivityItemType.TreasureBoxItem:
            if (_ActTreasureBoxCtrl == null)
            {
                _ActTreasureBoxCtrl = TreasureBoxController.CreatTreasureBoxCtr();
            }
            else
            {
                _ActTreasureBoxCtrl.gameObject.SetActive(true);
            }
            break;

        case ActivityItemType.RollGamblePanel:
            RollGambleController.CreatRollGamblePanel();
            break;

        case ActivityItemType.DailyGiftPanel:
            DailyGiftController.CreatDailyGiftController();
            break;

        case ActivityItemType.DragonBank:
            DragonBankController.CreatDragonBankController();
            break;

        default:
            //	AbsA = null;
            break;
        }
    }
Esempio n. 10
0
    protected override void OnEvent(EventTypeDefine p_e, object p_param)
    {
        switch (p_e)
        {
        case EventTypeDefine.Click_DuoBaoButton:
            FinalTrialMgr.GetInstance().m_NowTaskId  = Core.Data.guideManger.LastTaskID;
            FinalTrialMgr.GetInstance().m_LastTaskId = Core.Data.guideManger.LastTaskID;
            DBUIController.mDBUIInstance.SetViewState(EMViewState.S_QiangDuo);
            break;

        case EventTypeDefine.Click_MartialConference:

            FinalTrialMgr.GetInstance().m_NowTaskId = Core.Data.guideManger.LastTaskID;
            FinalTrialMgr.GetInstance().CreateScript(TrialEnum.TrialType_TianXiaDiYi, QiangduoEnum.QiangduoEnum_List);
            break;

        case EventTypeDefine.Click_Exchange_DuoBao:
            FinalTrialMgr.GetInstance().RequestByQiangduoType(QiangduoEnum.QiangduoEnum_Duihuan);
            //			FinalTrialMgr.GetInstance().qiangDuoPanelScript.MoveToTarget();
            break;

        case EventTypeDefine.Click_GetChaoShenShui:
            Core.Data.DuiHuanManager.buyZhanGongItem(1, 0);
            break;

        case EventTypeDefine.Click_BackToDuoBao:
            FinalTrialMgr.GetInstance().m_QiangduoEnum = QiangduoEnum.QiangduoEnum_Duihuan;
            FinalTrialMgr.GetInstance().qiangDuoPanelScript.OnBtnClose();
            break;

        case EventTypeDefine.Click_DuoBaoBackToMain:
            DBUIController.mDBUIInstance.mDuoBaoView.OnBtnQuit();
            break;

        case EventTypeDefine.Click_SevenRewardButton:
            UISevenDayRewardMain.OpenUI();
            break;

        case EventTypeDefine.Click_GetSevenReward:
            UISevenDayRewardMain.GetInstance().mReward.mCellList[0].SendMsg();
            Core.Data.guideManger.HideGuide();
            break;

        case EventTypeDefine.Click_CloseSevenReward:
            UISevenDayRewardMain.GetInstance().Back_OnClick();
            break;

        case EventTypeDefine.Click_RunTiaoZhanBtn:
            FinalTrialMgr.GetInstance().currentFightOpponentInfo = FinalTrialMgr.GetInstance().qiangDuoPanelScript.ListCell[0].fightOpponentInfo;
            Core.Data.temper._PvpEnemyName = FinalTrialMgr.GetInstance().qiangDuoPanelScript.ListCell[0].fightOpponentInfo.n;
            FinalTrialMgr.GetInstance().tianXiaDiYiFightRequest(FinalTrialMgr.GetInstance().qiangDuoPanelScript.ListCell[0].fightOpponentInfo.g,
                                                                FinalTrialMgr.GetInstance().qiangDuoPanelScript.ListCell[0].fightOpponentInfo.r, EMViewState.S_QiangDuo, Core.Data.temper.gambleTypeId);
            Core.Data.guideManger.HideGuide();
            break;

        case EventTypeDefine.Click_Shop:
            UIDragonMallMgr.GetInstance().OpenUI(ShopItemType.HotSale);
            break;

        case EventTypeDefine.Click_BuyFiveStarEgg:
            List <ItemData> mitems = Core.Data.itemManager.GetShopItem(ShopItemType.HotSale);
            ItemData        _data  = null;
            foreach (ItemData data in mitems)
            {
                if (data.ID == 110025)
                {
                    _data = data;
                    break;
                }
            }
            SecretShopMgr.GetInstance().SetSecretShopTag(true, _data, ShopItemType.HotSale, 2);
            break;

        case EventTypeDefine.Click_SureBuyFiveStarEgg:
            SecretShopMgr.GetInstance()._UISecretShopTag.Buy_OnClick();
            Core.Data.guideManger.HideGuide();
            break;

        case EventTypeDefine.Click_ExitShop:
            DBUIController.mDBUIInstance.mUIDragonMallMain.Back_OnClick();
            break;

        case EventTypeDefine.UnLock_God_And_SecondPos:
            //Core.Data.guideManger.AutoRUN();
            break;

        default:
            break;
        }
    }
Esempio n. 11
0
 void ReBuy_OnClick()
 {
     SecretShopMgr.GetInstance().SecretSoulHeroRequest();
 }
Esempio n. 12
0
    void BuyNormal_OnClick()
    {
        if (!CheckVipBuy())
        {
            return;
        }

        int mNeedMoney = 0;
        int mMoneyType = 0;

        if (_type == ShopItemType.Active)
        {
            mMoneyType = ActiveItemdata.mType;
            if (ActiveItemdata.disPrice == 0)
            {
                mNeedMoney = ActiveItemdata.price;
            }
            else
            {
                mNeedMoney = ActiveItemdata.disPrice;
            }
        }
        else
        {
            if (mdata.discount.Length != 0)
            {
                mMoneyType = mdata.discount[0];
                mNeedMoney = mdata.discount[1];
            }
            else
            {
                if (mdata.price.Length != 0)
                {
                    mMoneyType = mdata.price[0];
                    mNeedMoney = mdata.price[1];
                }
            }
        }


        if (mMoneyType == 0)
        {
            if (Core.Data.playerManager.Coin < mNeedMoney)
            {
                JCRestoreEnergyMsg.OpenUI(ItemManager.COIN_PACKAGE, ItemManager.COIN_BOX, 2);
                return;
            }
        }
        else if (mMoneyType == 1)
        {
            if (Core.Data.playerManager.Stone < mNeedMoney)
            {
                SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(35006));
                return;
            }

            // talkingdata add by wxl
            if (_type == ShopItemType.Active)
            {
                TDataOnBuyItem(ActiveItemdata.pid, 1, mNeedMoney);
            }
            else
            {
                TDataOnBuyItem(mdata.ID, 1, mNeedMoney);
            }
        }
        else
        {
            if (mMoneyType != 2 && mMoneyType != 3)
            {
                int      _battlesoul = 0;
                ItemData data        = null;
                _battlesoul = Core.Data.itemManager.GetBagItemCount(mMoneyType);
                data        = Core.Data.itemManager.getItemData(mMoneyType);

                if (_battlesoul < mNeedMoney)
                {
                    if (data != null)
                    {
                        SQYAlertViewMove.CreateAlertViewMove(string.Format(Core.Data.stringManager.getString(25174), data.name));
                    }
                    return;
                }
            }
            else
            {
                SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(7999));

                return;
            }
        }

        HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response);

        if (_type != ShopItemType.Active)
        {
            PurchaseParam param = new PurchaseParam();
            param.gid    = Core.Data.playerManager.PlayerID;
            param.propid = mdata.ID;
            if (this.mdata.max == 0)
            {
                param.nm = 1;
            }
            else
            {
                param.nm = BuyNumber.NumIndex;
            }
            task.AppendCommonParam(RequestType.BUY_ITEM, param);
        }
        else
        {
            BuyActiveShopItemParam param = new BuyActiveShopItemParam();
            param.gid    = int.Parse(Core.Data.playerManager.PlayerID);
            param.propid = ActiveItemdata.pid;
            param.nm     = 1;
            task.AppendCommonParam(RequestType.ACTIVESHOPBUYITEM, param);
        }
        if (Core.Data.guideManger.isGuiding)
        {
            task.afterCompleted += SecretShopMgr.GetInstance().testHttpResp_UI;
        }
        else
        {
            task.afterCompleted += SecretShopMgr.GetInstance()._UIDragonMallCell.testHttpResp_UI;
        }
        task.DispatchToRealHandler();
        ComLoading.Open();
        Back_OnClick();
    }