| | |
| | | FuncConfigConfig config = FuncConfigConfig.Get("FirstCharge"); |
| | | taskID = int.Parse(config.Numerical1); |
| | | nextTaskID = int.Parse(config.Numerical2); |
| | | |
| | | |
| | | InitClickTabDict(); |
| | | InitRedPoint(); |
| | | } |
| | |
| | | firstChargeInfoDict.Clear(); |
| | | } |
| | | |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | if (IsFuncOpen() && TryGetUnBuyFirstId(out int firstId)) |
| | |
| | | return; |
| | | if (!TryGetUnBuyFirstId(out int firstId)) |
| | | return; |
| | | if (!UIManager.Instance.IsOpened<FirstChargeWin>()) |
| | | int localTime = GetLocalFailTime(); |
| | | |
| | | DateTime lastFailTime = TimeUtility.GetTime((uint)localTime); |
| | | DateTime now = TimeUtility.ServerNow; |
| | | |
| | | // 从未记录过死亡或上次死亡时间是否与当前时间不在同一天 |
| | | if (localTime == 0 || lastFailTime.Year != now.Year || lastFailTime.Month != now.Month || lastFailTime.Day != now.Day) |
| | | { |
| | | UIManager.Instance.OpenWindow<FirstChargeWin>(); |
| | | SetLocalFailTime(TimeUtility.AllSeconds); |
| | | if (!UIManager.Instance.IsOpened<FirstChargeWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<FirstChargeWin>(); |
| | | } |
| | | } |
| | | // 如果同一天已经死亡过,则不弹窗 |
| | | } |
| | | string failTimeKey = "FirstCharge_FailTime_"; |
| | | public int GetLocalFailTime() |
| | | { |
| | | return LocalSave.GetInt(StringUtility.Concat(failTimeKey + PlayerDatas.Instance.PlayerId)); |
| | | } |
| | | |
| | | public void SetLocalFailTime(int time) |
| | | { |
| | | LocalSave.SetInt(StringUtility.Concat(failTimeKey + PlayerDatas.Instance.PlayerId), time); |
| | | } |
| | | |
| | | public string loaclKey = "FirstCharge_Fail_"; |