Exemplo n.º 1
0
        private void RefreshData(bool refreshUI)
        {
            if (campPointMgr == null)
            {
                return;
            }

            double rewardFactor;
            float  intervalFactor;

            campPointMgr.GetCardTotalFactorOnPoint(cardId, out rewardFactor, out intervalFactor);

            bool auto = campPointMgr.CheckCardIsAuto(cardId);

            if (refreshUI)
            {
                RewardFactorBefore.text.text = string.Format("x{0}", UiTools.FormateMoney(recordRewardFactor));
                RewardFactorCur.text.text    = string.Format("x{0}", UiTools.FormateMoney(rewardFactor));

                if (auto != recordAuto)
                {
                    AutoDataChange.gameObject.SetActive(true);
                    AutoData.gameObject.SetActive(false);
                    AutoValBefore.text.text = LanguageMgr.GetText(recordAuto ? "CardPage_Tips_Open" : "CardPage_Tips_Close");
                    AutoValCur.text.text    = LanguageMgr.GetText(auto ? "CardPage_Tips_Open" : "CardPage_Tips_Close");
                }
                else
                {
                    AutoDataChange.gameObject.SetActive(false);
                    AutoData.gameObject.SetActive(true);
                    if (auto)
                    {
                        AutoVal.text.text = LanguageMgr.GetText("CardPage_Tips_Open");
                        AutoLvTip.gameObject.SetActive(false);
                    }
                    else
                    {
                        AutoVal.text.text   = LanguageMgr.GetText("CardPage_Tips_Close");
                        AutoLvTip.text.text = LanguageMgr.GetText("CardPage_Tips_Tips", campPointMgr.AutoLv);
                        AutoLvTip.gameObject.SetActive(true);
                    }
                }
            }

            recordRewardFactor = rewardFactor;
            recordAuto         = auto;
        }
Exemplo n.º 2
0
        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);
            }
        }