private void RefreshData(int dataIndex)
        {
            if (pointDataMgr != null && dataIndex != pointDataMgr.index)
            {
                return;
            }
            LvTxt.text.text       = string.Format("Lv.{0}", pointDataMgr.Lv);
            RewardTxt.text.text   = UiTools.FormateMoney(pointDataMgr.OnceRewardVal);
            IntervalTxt.text.text = LanguageMgr.GetText("CampDetail_Text_Time", pointDataMgr.RewardInterval);
            AutoTipTxt.text.text  = LanguageMgr.GetText("CampDetail_Tips_Auto", pointDataMgr.AutoLv);
            if (pointDataMgr.isAuto)
            {
                UIGray.Recovery(AutoIcon.image);
                AutoTxt.text.text     = LanguageMgr.GetText("CampDetail_Rule_AutoOpen");
                AutoTxt.text.color    = Color.green;
                AutoTipTxt.text.color = Color.green;
                DescTxt.text.text     = LanguageMgr.GetText("CampDetail_Text_Upgrade");
            }
            else
            {
                UIGray.SetUIGray(AutoIcon.image);
                AutoTxt.text.text     = LanguageMgr.GetText("CampDetail_Rule_AutoClose");
                AutoTxt.text.color    = Color.red;
                AutoTipTxt.text.color = Color.red;
                if (pointDataMgr.equipGunId > 0)
                {
                    DescTxt.text.text = LanguageMgr.GetText("CampDetail_Text_NOAuto");
                }
                else
                {
                    DescTxt.text.text = LanguageMgr.GetText("CampDetail_Text_NoWeapon");
                }
            }

            var lvUpCost = pointDataMgr.GetLvUpCost(1);

            CostTxt.text.text = UiTools.FormateMoney(lvUpCost);
            if (lvUpCost <= CampsiteMgr.singleton.TotalRewardVal)
            {
                CostTxt.text.color = Color.white;
            }
            else
            {
                CostTxt.text.color = Color.red;
            }

            if (pointDataMgr.equipGunId > 0)
            {
                CardData.gameObject.SetActive(true);
                CardData.GunUI_GunCard.Init(TableMgr.singleton.GunCardTable.GetItemByID(pointDataMgr.equipGunId));
                SetGunTxt.text.text = LanguageMgr.GetText("CampDetail_Button_Change");
            }
            else
            {
                CardData.gameObject.SetActive(false);
                SetGunTxt.text.text = LanguageMgr.GetText("CampDetail_Button_Equi");
            }
        }
示例#2
0
 public void SetValid(bool valid)
 {
     if (valid)
     {
         UIGray.Recovery(IconBtn.image);
     }
     else
     {
         UIGray.SetUIGray(IconBtn.image);
     }
 }
示例#3
0
    private void ModiTryButton()
    {
        if (!TimeUtil.isNetworkOn())
        {
            UIGray.SetUIGray(tryButton.GetComponent <Image>());
            UIGray.SetUIGray(AdImgTrans.GetComponent <Image>());

            tryButton.interactable = false;
            tryButtonText.color    = Color.grey;
            UIMgr.GetInstance().ShowSimpleTips(306);
            return;
        }
        else
        {
            UIGray.Recovery(tryButton.GetComponent <Image>());
            UIGray.Recovery(AdImgTrans.GetComponent <Image>());

            tryButtonText.color    = normalTryButtonTextColor;
            tryButton.interactable = true;
        }

        if (m_selectedDateTime != DateTime.Today && !m_selectedDayObject.GetComponent <DayTest>().isChallenged)
        {
            //还需要读取多语言配置
            LanguageMgr.GetInstance().GetLangStrByID(tryButtonText, 304);//"挑战关卡"
            RectUtils.SetLeft(tryButtonText.GetComponent <RectTransform>(), 95);
            AdImgTrans.gameObject.SetActive(true);
        }
        else if (m_selectedDateTime == DateTime.Today)
        {
            LanguageMgr.GetInstance().GetLangStrByID(tryButtonText, 304);//"挑战关卡"
            RectUtils.SetLeft(tryButtonText.GetComponent <RectTransform>(), 10);
            AdImgTrans.gameObject.SetActive(false);
        }
        else
        {
            LanguageMgr.GetInstance().GetLangStrByID(tryButtonText, 305);//"再次挑战"

            RectUtils.SetLeft(tryButtonText.GetComponent <RectTransform>(), 10);
            AdImgTrans.gameObject.SetActive(false);
        }
    }
        private void RefreshData(CampsitePointMgr targetPoint, int cardId)
        {
            var gunRes = TableMgr.singleton.GunCardTable.GetItemByID(cardId);

            CardData.gameObject.SetActive(true);
            CardData.GunUI_GunCard.Init(gunRes);

            int skillId = PlayerDataMgr.singleton.GetCampSkillID(cardId);

            CampSkill.CampSkill.Init(skillId);
            CampSkill.CampSkill.SetValid(targetPoint.CheckIsValidSkill(skillId));
            AutoTipTxt.text.text = LanguageMgr.GetText("CampDetail_Tips_Auto", targetPoint.AutoLv);
            if (targetPoint.CheckCardIsAuto(cardId))
            {
                UIGray.Recovery(AutoIcon.image);
                AutoTxt.text.text     = LanguageMgr.GetText("CampDetail_Rule_AutoOpen");
                AutoTxt.text.color    = Color.green;
                AutoTipTxt.text.color = Color.green;
            }
            else
            {
                UIGray.SetUIGray(AutoIcon.image);
                AutoTxt.text.text     = LanguageMgr.GetText("CampDetail_Rule_AutoClose");
                AutoTxt.text.color    = Color.red;
                AutoTipTxt.text.color = Color.red;
            }

            double rewardFactor;
            float  intervalFactor;

            targetPoint.GetCardTotalFactorOnPoint(cardId, out rewardFactor, out intervalFactor);
            RewardFactorTxt.text.text = string.Format("x{0}", UiTools.FormateMoney(rewardFactor));
            if (Mathf.Approximately(intervalFactor, 1f))
            {
                IntervalFactorNode.gameObject.SetActive(false);
            }
            else
            {
                IntervalFactorTxt.text.text = string.Format("-{0:#0.##%}", intervalFactor);
            }
        }
示例#5
0
 public void SetGray()
 {
     UIGray.SetUIGray(bg);
 }