Пример #1
0
    public override void Update()
    {
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (kMyCharInfo == null)
        {
            return;
        }
        if (this.oldMoney != kMyCharInfo.m_Money)
        {
            this.oldMoney  = kMyCharInfo.m_Money;
            this.gold.Text = ANNUALIZED.Convert(kMyCharInfo.m_Money);
        }
        if (NrTSingleton <ContentsLimitManager> .Instance.IsWillSpend())
        {
            COMMON_CONSTANT_Manager instance = COMMON_CONSTANT_Manager.GetInstance();
            if (Time.realtimeSinceStartup >= kMyCharInfo.m_fCurrentActivityTime && kMyCharInfo.m_fCurrentActivityTime != 0f)
            {
                float num = 600f;
                if (instance != null)
                {
                    if (NrTSingleton <ContentsLimitManager> .Instance.IsVipExp())
                    {
                        num = (float)instance.GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_UPDATE_ACTIVITY_MINUTE) * 60f;
                    }
                    else
                    {
                        short vipLevelActivityTime = NrTSingleton <NrTableVipManager> .Instance.GetVipLevelActivityTime();

                        num = (float)(instance.GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_UPDATE_ACTIVITY_MINUTE) - (int)vipLevelActivityTime) * 60f;
                    }
                }
                kMyCharInfo.m_fCurrentActivityTime = num + kMyCharInfo.m_fCurrentActivityTime;
                if (kMyCharInfo.m_nActivityPoint < kMyCharInfo.m_nMaxActivityPoint)
                {
                    kMyCharInfo.AddActivityPoint(1L);
                }
            }
            if (this.m_nCurrentActivity != kMyCharInfo.m_nActivityPoint || this.m_nMaxActivity != kMyCharInfo.m_nMaxActivityPoint)
            {
                this.m_nCurrentActivity = kMyCharInfo.m_nActivityPoint;
                this.m_nMaxActivity     = kMyCharInfo.m_nMaxActivityPoint;
                this.SetActivityPointUI();
            }
            if (this.m_fActivityUpdateTime < Time.realtimeSinceStartup)
            {
                float num2 = kMyCharInfo.m_fCurrentActivityTime - Time.realtimeSinceStartup;
                int   num3 = (int)(num2 / 3600f);
                int   num4 = (int)((num2 - (float)num3 * 3600f) / 60f);
                int   num5 = (int)((num2 - (float)num3 * 3600f - (float)num4 * 60f) % 60f);
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref this.m_szStrActivityTime, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("89"),
                    "min",
                    num4.ToString("00"),
                    "sec",
                    num5.ToString("00")
                });

                this.m_lbActivityTime.SetText(this.m_szStrActivityTime);
                this.m_fActivityUpdateTime = Time.realtimeSinceStartup + 1f;
            }
        }
        if (this.m_iHeartsNum != NkUserInventory.GetInstance().Get_First_ItemCnt(70000))
        {
            this.m_iHeartsNum = NkUserInventory.GetInstance().Get_First_ItemCnt(70000);
            this.m_lbHearts.SetText(ANNUALIZED.Convert(this.m_iHeartsNum));
        }
        if (this.m_iSoulGemsNum != NkUserInventory.GetInstance().Get_First_ItemCnt(70002))
        {
            this.m_iSoulGemsNum = NkUserInventory.GetInstance().Get_First_ItemCnt(70002);
            this.m_lbSoulGems.SetText(ANNUALIZED.Convert(this.m_iSoulGemsNum));
        }
        if (NrTSingleton <ContentsLimitManager> .Instance.IsTimeShop())
        {
            this.Update_TimeShopRemainTime();
        }
    }