Esempio n. 1
0
    public void InitBtnState()
    {
        if (!isRequest)
        {
            return;
        }

        if (BtnGameManagerBack.isTown())
        {
            tempLeaveBtn.isEnabled = false;
        }

        if (!BtnGameManagerBack.isTown() || skipLayers <= 0)
        {
            skipChallengeBtn.isEnabled = false;
        }

        if (gold <= 0)// gold小于0表示无奖励可领取
        {
            rewardLeaveBtn.isEnabled = false;
        }
        else
        {
            rewardLeaveBtn.isEnabled = true;
        }

        if (currLayer >= maxTowerLevel)
        {
            startChallengeBtn.isEnabled = false;
            flashSprite.GetComponent <UISprite>().enabled = false;
        }
    }
Esempio n. 2
0
 public void TempLeaveBtn()
 {
     if (BtnGameManagerBack.isTown())
     {
         return;
     }
     PanelStatic.StaticBtnGameManagerBack.UICL.SendMessage("nowYesReturn", SendMessageOptions.RequireReceiver);
 }
Esempio n. 3
0
    public void SetChallengeBtnTxt()
    {
        if (BtnGameManagerBack.isTown())
        {
            //if (currLayer < 1)
            //{
            //    startChallengeTxt.text = StaticLoc.Loc.Get("info1149");// 开始挑战
            //}
            //else
            //{
            //    startChallengeTxt.text = StaticLoc.Loc.Get("info1150"); // 继续挑战
            //}

            if (towerState == CommonDefine.TOWER_STATE_NOT_START)
            {
                startChallengeTxt.text = StaticLoc.Loc.Get("info1149");// 开始挑战
            }
            else
            {
                startChallengeTxt.text = StaticLoc.Loc.Get("info1150"); // 继续挑战
            }
        }
        //else
        //{
        //    startChallengeTxt.text = StaticLoc.Loc.Get("info1150"); // 继续挑战
        //    startChallengeBtn.isEnabled = false;
        //}

        if (remianChallengeTime <= 0 && towerState == CommonDefine.TOWER_STATE_NOT_START)
        {
            if (!isRequest)
            {
                return;
            }

            startChallengeBtn.isEnabled = false;
            flashSprite.GetComponent <UISprite>().enabled = false;
            flashSprite.SetActive(false);
        }
        else if (towerState == CommonDefine.TOWER_STATE_NOT_START && remianChallengeTime > 0 && gold > 0) // 前一天没有领奖,当天继续挑战后死亡,只能领奖,不能继续挑战,领奖后才可继续挑战
        {
            startChallengeBtn.isEnabled = false;
            flashSprite.GetComponent <UISprite>().enabled = false;
            flashSprite.SetActive(false);
        }
        else
        {
            if (!isRequest)
            {
                return;
            }

            startChallengeBtn.isEnabled = true;
            flashSprite.GetComponent <UISprite>().enabled = true;
            flashSprite.SetActive(true);
        }
    }
Esempio n. 4
0
    public void CloseAndLeave()
    {
        PanelStatic.StaticWarnings.warningAllEnterClose.btnEnter.functionName = "";
        PanelStatic.StaticWarnings.warningAllEnterClose.Close();

        if (!BtnGameManagerBack.isTown())
        {
            PanelStatic.StaticBtnGameManagerBack.UICL.SendMessage("nowYesReturn", SendMessageOptions.RequireReceiver);
        }
    }
Esempio n. 5
0
    private int maxTowerLevel = 30;// 困魔塔最大层数
    // Use this for initialization
    void Start()
    {
        yuan.YuanMemoryDB.YuanTable bossTower = YuanUnityPhoton.GetYuanUnityPhotonInstantiate().ytBosstower;
        List <string> ids = bossTower.GetColumnText("id");

        maxTowerLevel = ids.Count;
        int layer = 0;

        yuan.YuanMemoryDB.YuanRow yRow = null;
        string item = "";

        for (int i = 0; i < ids.Count; i++)
        {
            layer = int.Parse(ids[i]);

            yRow = bossTower.SelectRowEqual("id", ids[i]);
            bossTowerInfoDic.Add(layer, yRow);
            item = yRow["itemlist"].YuanColumnText.Trim();
            if (string.IsNullOrEmpty(item))
            {
                continue;
            }
            string[] items = item.Split(';');
            itemList.Add(layer, items);

            if (i == maxTowerLevel - 1)
            {
                //显示首次通关奖励
                string rewardItem = yRow["rewarditem"].YuanColumnText.Trim();
                if (!string.IsNullOrEmpty(rewardItem))
                {
                    firstRewardItem.SetItemInfo(rewardItem);
                    firstRewardItem.DisableItem();
                }
            }
        }


        //if (isFirst)
        //{
        //    //yield return new WaitForSeconds(1.0f);
        //    InitItemGrid();
        //    InitGoldAndExp(currLayer);
        //    isFirst = false;
        //}

        if (!BtnGameManagerBack.isTown())
        {
            closeBtn.SetActive(false);
        }
    }
Esempio n. 6
0
 public void ChallengeBtnClick()
 {
     int[] towerInfo = new int[2];
     //towerInfo[0] = currLayer == 0 ? 1 : currLayer;// 困魔塔层数
     towerInfo[0] = currLayer + 1; // 困魔塔层数
     towerInfo[1] = towerLevel;    // 困魔塔难度
     if (BtnGameManagerBack.isTown())
     {
         PanelStatic.StaticBtnGameManagerBack.UICL.SendMessage("TrappedtowerLoadLevel", towerInfo, SendMessageOptions.RequireReceiver);// 如果在主城Loading场景
     }
     else
     {
         Debug.Log("ChallengeBtnClick===================towernumber" + towerInfo[0]);
         PanelStatic.StaticBtnGameManagerBack.UICL.SendMessage("TrappedtowerCallMonsterAsNum", towerInfo[0], SendMessageOptions.RequireReceiver);// 如果在副本直接调用刷怪
         PanelStatic.StaticBtnGameManagerBack.UICL.SendMessage("show0", SendMessageOptions.RequireReceiver);
     }
 }
Esempio n. 7
0
    void OnEnable()
    {
        //DisableItems();

        SetDescriptionTxt();

        PanelStatic.StaticBtnGameManager.RunOpenLoading(() => ServerRequest.requestTowerOpen());

        //if (!isFirst)
        //{
        //    InitItemGrid();
        //    InitGoldAndExp(currLayer);
        //}

        if (!BtnGameManagerBack.isTown())
        {
            closeBtn.SetActive(false);
        }
    }
Esempio n. 8
0
    public void SetSkipChallengeTxt(int layer, int hasReward)
    {
        //skipLayers = layer - layer % 5;
        skipLayers            = layer > 1 ? layer : 0;
        skipChallengeTxt.text = StaticLoc.Loc.Get("tower005") + skipLayers + StaticLoc.Loc.Get("tower009");

        if (!BtnGameManagerBack.isTown() || skipLayers < 1)
        {
            skipChallengeBtn.isEnabled = false;
        }
        else
        {
            if (remianChallengeTime <= 0 || 1 == hasReward)// 没有挑战次数或者有奖励可领取时,不允许扫荡
            {
                skipChallengeBtn.isEnabled = false;
            }
            else
            {
                skipChallengeBtn.isEnabled = true;
            }
        }
    }
Esempio n. 9
0
    public void SetCurrLayerTxt(int layers)
    {
        if (BtnGameManagerBack.isTown())
        {
            currentLayer.text = StaticLoc.Loc.Get("tower003") + (layers + 1);
        }
        else
        {
            currentLayer.text = StaticLoc.Loc.Get("tower003") + (layers + 1);
        }

        if (layers >= maxTowerLevel)
        {
            currentLayer.text           = StaticLoc.Loc.Get("tower003") + StaticLoc.Loc.Get("info689");
            startChallengeBtn.isEnabled = false;
            flashSprite.GetComponent <UISprite>().enabled = false;
            layers = maxTowerLevel;
        }

        currLayer = layers;

        InitItemGrid();
        InitGoldAndExp(currLayer);
    }