Beispiel #1
0
    public IEnumerator YuanOnEnable()
    {
        if (InRoom.GetInRoomInstantiate().GetServerSwitchString(yuan.YuanPhoton.BenefitsType.RedemptionCodeSwitch) != "1")
        {
            if (btnCode != null)
            {
                btnCode.SetActiveRecursively(false);
            }
        }
        yuan.YuanClass.SwitchList(listPanel, true, true);
        yield return(new WaitForFixedUpdate());

        firstBtn.OnClick();
    }
    public IEnumerator YuanOnEnable()
    {
        BtnSelect tempBtn = null;

        if (InRoom.GetInRoomInstantiate().GetServerSwitchString(yuan.YuanPhoton.BenefitsType.RedemptionCodeSwitch) != "1")
        {
            if (btnCode != null)
            {
//				btnFirst.gameObject.SetActiveRecursively (false);
            }
        }


        // int openNum = int.Parse(BtnGameManager.yt.Rows[0]["Serving"].YuanColumnText == "" ? "0" : BtnGameManager.yt.Rows[0]["Serving"].YuanColumnText) - int.Parse(BtnGameManager.yt.Rows[0]["NumOpenBox"].YuanColumnText == "" ? "0" : BtnGameManager.yt.Rows[0]["NumOpenBox"].YuanColumnText) + 1;

        //if (BtnGameManager.yt.Rows[0]["CanDailyBenefits"].YuanColumnText.Trim() == "1")
        if (isOneLeveBag)
        {
            isOneLeveBag = false;
            tempBtn      = btnLeveBag;
        }
        else
        if (int.Parse(BtnGameManager.yt[0]["DailyBenefits"].YuanColumnText) > int.Parse(BtnGameManager.yt.Rows[0]["CanDailyBenefits"].YuanColumnText))
        {
            tempBtn = btnLogin;
        }
        else if (BtnGameManager.yt.Rows[0]["CanSalaries"].YuanColumnText == "1")
        {
            tempBtn = btnSalaries;
        }
        //else if(openNum>0)
        else if (!BtnGameManager.yt.Rows[0]["OpenedChests"].YuanColumnText.Equals("-1,-1,-1,-1"))
        {
            tempBtn = btnChest;
        }
//		else if (BtnGameManager.yt.Rows[0]["IsGetFirstVIP"].YuanColumnText == "1")
//		{
//			tempBtn=btnLogin;
//		}
//		else  if (BtnGameManager.yt.Rows[0]["CanRankBenefits"].YuanColumnText == "1"&&BtnGameManager.yt.Rows[0]["Rank"].YuanColumnText != "" && BtnGameManager.yt.Rows[0]["Rank"].YuanColumnText != "0")
//		{
//			tempBtn=btnChest;
//		}
//		else if (BtnGameManager.yt.Rows[0]["CanGuildBenefits"].YuanColumnText == "1"&&BtnGameManager.yt.Rows[0]["GuildContribution"].YuanColumnText != "" && BtnGameManager.yt.Rows[0]["GuildContribution"].YuanColumnText != "0")
//		{
//			tempBtn=btnGuild;
//		}
        else
        {
            if (btnSalaries.gameObject.activeSelf)
            {
                tempBtn = btnChest;
            }
            else
            {
                tempBtn = btnSalaries;
            }
        }

        yuan.YuanClass.SwitchList(listPanel, true, true);
//		foreach (GameObject item in listPanel)
//		{
//			item.SetActiveRecursively(true);
//		}

        yield return(new WaitForFixedUpdate());

        tempBtn.OnClick();
        if (BtnGameManager.yt.Rows[0]["GuildContribution"].YuanColumnText == "" || BtnGameManager.yt.Rows[0]["GuildContribution"].YuanColumnText == "0")
        {
            btnLogin.btnDisable.Disable = true;
        }
        if (BtnGameManager.yt.Rows[0]["Rank"].YuanColumnText == "" || BtnGameManager.yt.Rows[0]["Rank"].YuanColumnText == "0")
        {
            if (btnGuild)
            {
                btnGuild.btnDisable.Disable = true;
            }
        }

        if (null != targetBtn)
        {
            targetBtn.OnClick();
            targetBtn = null;
        }
    }