| | |
| | | {
|
| | | public int[] normalBuyCoinsTypes { get; private set; }
|
| | | public string UNIONSTORESAVE_KEY { get; private set; }
|
| | | public string MUSTBUYSAVE_KEY { get; private set; }
|
| | | public string StoreEffectRecord_Key { get; private set; }
|
| | | public List<StoreConfig> shoplist;
|
| | |
|
| | |
| | | public void OnAfterPlayerDataInitialize()
|
| | | {
|
| | | UNIONSTORESAVE_KEY = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, LocalSaveStoreType.UnionStore);
|
| | | DebugEx.Log("UNIONSTORESAVE_KEY:" + UNIONSTORESAVE_KEY);
|
| | | StoreEffectRecord_Key = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "StoreEffectRecord");
|
| | | MUSTBUYSAVE_KEY = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID,"MustBuy");
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | |
| | | public bool CheckWeekStoreIsShopBuy(out List<StoreConfig> buylist)
|
| | | {
|
| | | buylist = new List<StoreConfig>();
|
| | | if (!IsNewDay()) return false;
|
| | | if (!IsNewDay(StoreEffectRecord_Key)) return false;
|
| | |
|
| | | List<StoreConfig> shoplist = StoreConfig.GetTypeStoreModel((int)StoreFunc.WeekStore);
|
| | | for(int i = 0; i < shoplist.Count; i++)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private bool IsNewDay()
|
| | | private bool IsNewDay(string recordKey)
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Store)) return false;
|
| | |
|
| | | if (PlayerPrefs.HasKey(StoreEffectRecord_Key))
|
| | | if (PlayerPrefs.HasKey(recordKey))
|
| | | {
|
| | | int day = LocalSave.GetInt(StoreEffectRecord_Key);
|
| | | int day = LocalSave.GetInt(recordKey);
|
| | | if(day != TimeUtility.ServerNow.Day)
|
| | | {
|
| | | LocalSave.SetInt(StoreEffectRecord_Key,TimeUtility.ServerNow.Day);
|
| | | LocalSave.SetInt(recordKey, TimeUtility.ServerNow.Day);
|
| | | return true;
|
| | | }
|
| | | else
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | LocalSave.SetInt(StoreEffectRecord_Key, TimeUtility.ServerNow.Day);
|
| | | LocalSave.SetInt(recordKey, TimeUtility.ServerNow.Day);
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
| | | shopRedDict[storeConfig.ID].state = RedPointState.None;
|
| | | }
|
| | | }
|
| | |
|
| | | UpdateMustBuyRedpoint(storeConfig);
|
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateMustBuyRedpoint(StoreConfig storeConfig)
|
| | | {
|
| | | if (CheckIsMustBuy(storeConfig))
|
| | | {
|
| | | shopRedDict[storeConfig.ID].state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | shopRedDict[storeConfig.ID].state = RedPointState.None;
|
| | | }
|
| | | }
|
| | |
|
| | | public void ClearMustBuyRedpoint(StoreConfig storeConfig)
|
| | | {
|
| | | if(mustIdlist.Contains(storeConfig.ItemID))
|
| | | {
|
| | | shopRedDict[storeConfig.ID].state = RedPointState.None;
|
| | | }
|
| | | }
|
| | |
|
| | | public List<int> mustIdlist = new List<int>() { 4741};
|
| | | public bool CheckIsMustBuy(StoreConfig config)
|
| | | {
|
| | | if(mustIdlist.Contains(config.ItemID)
|
| | | && CheckShopIsCanBuy(config))
|
| | | {
|
| | | if(IsNewDay(MUSTBUYSAVE_KEY))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool CheckScoreStoreIsCanBuy(StoreConfig storeConfig)
|
| | | {
|
| | | List<StoreConfig> list = StoreConfig.GetSellShoplist();
|