// Token: 0x0600D283 RID: 53891 RVA: 0x00397DB4 File Offset: 0x00395FB4
        public void UpdatePlayerResource()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_UpdatePlayerResource_hotfix != null)
            {
                this.m_UpdatePlayerResource_hotfix.call(new object[]
                {
                    this
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;

            this.SetGoldCount(projectLPlayerContext.GetGold());
            this.SetCrystalCount(projectLPlayerContext.GetCrystal());
            this.SetEnergy(projectLPlayerContext.GetEnergy(), projectLPlayerContext.GetEnergyMax());
        }
Exemplo n.º 2
0
        // Token: 0x06014D49 RID: 85321 RVA: 0x00547FFC File Offset: 0x005461FC
        protected override void UpdateView()
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_UpdateView_hotfix != null)
            {
                this.m_UpdateView_hotfix.call(new object[]
                {
                    this
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            if (base.IsOpeningUI())
            {
                this.m_energyStatusUIController.SetEnergyStatusPosition(this.m_energyStatusPosition);
                this.m_energyStatusUIController.Open();
            }
            ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
            IConfigDataLoader     configDataLoader      = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;

            this.m_energyStatusUIController.SetNow(projectLPlayerContext.GetServerTime());
            int      num            = projectLPlayerContext.GetEnergyMax() - projectLPlayerContext.GetEnergy();
            TimeSpan timeSpan       = projectLPlayerContext.GetEnergyFlushTime() + TimeSpan.FromSeconds((double)configDataLoader.ConfigableConstId_EnergyAddPeriod) - projectLPlayerContext.GetServerTime();
            TimeSpan recoverAllTime = TimeSpan.Zero;

            if (num <= 0)
            {
                timeSpan       = TimeSpan.Zero;
                recoverAllTime = TimeSpan.Zero;
            }
            else
            {
                recoverAllTime = timeSpan + TimeSpan.FromSeconds((double)((num - 1) * configDataLoader.ConfigableConstId_EnergyAddPeriod));
            }
            this.m_energyStatusUIController.SetRecoverTime(timeSpan);
            this.m_energyStatusUIController.SetRecoverAllTime(recoverAllTime);
        }