| | |
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
| | | BlastFurnaceModel blastModel { get { return ModelCenter.Instance.GetModel<BlastFurnaceModel>(); } }
|
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | Dictionary<int, int> prayDrugDict = new Dictionary<int, int>(); //丹药id 特效id
|
| | | |
| | | public string prayDrugRecordKey;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | SetPrayDrugCondi();
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= UpdateFuncState;
|
| | | blastModel.RefreshStoveModelEvent -= UpdateBlastLv;
|
| | | playerPack.RefreshItemSumUseCntAct -= RefreshItemUsce;
|
| | | |
| | | }
|
| | |
|
| | | public void OnAfterPlayerDataInitialize()
|
| | |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += UpdateFuncState;
|
| | | blastModel.RefreshStoveModelEvent += UpdateBlastLv;
|
| | | playerPack.RefreshItemSumUseCntAct += RefreshItemUsce;
|
| | | prayDrugRecordKey = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "PrayDrugRecord");
|
| | | SetIsNewDay();
|
| | | UpdatePrayDanRedpoint();
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | return prayDrugDict;
|
| | | }
|
| | |
|
| | | public bool IsNewDay { get; private set; }
|
| | | public void SetIsNewDay()
|
| | | {
|
| | | if (IsNewDay) return;
|
| | |
|
| | | if (PlayerPrefs.HasKey(prayDrugRecordKey))
|
| | | {
|
| | | int day = LocalSave.GetInt(prayDrugRecordKey);
|
| | | if (day != TimeUtility.ServerNow.Day)
|
| | | {
|
| | | IsNewDay = true;
|
| | | LocalSave.SetInt(prayDrugRecordKey, TimeUtility.ServerNow.Day);
|
| | | }
|
| | | else
|
| | | {
|
| | | IsNewDay = false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | IsNewDay = true;
|
| | | LocalSave.SetInt(prayDrugRecordKey, TimeUtility.ServerNow.Day);
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 协议
|
| | |
| | | {
|
| | | if (blastModel.StoveLV < prayPushLv
|
| | | || alreadyPrayNum >= everyDayNum
|
| | | || GetPrayDruglist().Count < 1)
|
| | | || GetPrayDruglist().Count < 1
|
| | | || !IsNewDay)
|
| | | {
|
| | | prayRedpoint.state = RedPointState.None;
|
| | | return;
|
| | |
| | | prayRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | |
|
| | |
|
| | | public void ClearPrayRedpoint()
|
| | | {
|
| | | prayRedpoint.state = RedPointState.None;
|
| | | IsNewDay = false;
|
| | | }
|
| | | #endregion
|
| | | }
|
| | | }
|