2023-12-25 18:51:23 +08:00
|
|
|
using System.Collections.Generic;
|
2024-04-09 18:44:57 +08:00
|
|
|
using Cysharp.Threading.Tasks;
|
2023-12-22 15:27:48 +08:00
|
|
|
using Framework;
|
2024-03-25 17:08:42 +08:00
|
|
|
using Gameplay;
|
2024-07-08 13:20:11 +08:00
|
|
|
using Gameplay.Guide;
|
2023-12-22 15:27:48 +08:00
|
|
|
using PhxhSDK;
|
2024-04-29 14:22:22 +08:00
|
|
|
using Unity.Mathematics;
|
2024-03-25 17:08:42 +08:00
|
|
|
using Constants = PhxhSDK.Constants;
|
2023-12-22 15:27:48 +08:00
|
|
|
|
2024-04-12 17:18:10 +08:00
|
|
|
public class SignUpManager : Singlenton<SignUpManager>, IInitable
|
2023-12-22 15:27:48 +08:00
|
|
|
{
|
2023-12-25 18:51:23 +08:00
|
|
|
private Dictionary<int, SignObjAccumulate> _accumulateDic;
|
|
|
|
|
|
|
|
|
|
public void Init()
|
|
|
|
|
{
|
2024-04-29 14:22:22 +08:00
|
|
|
_accumulateDic = new Dictionary<int, SignObjAccumulate>();
|
2023-12-25 18:51:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Release()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void _CreateSignObjs()
|
|
|
|
|
{
|
|
|
|
|
_CreateAccumulateObjs();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//创建累计充值的对象
|
|
|
|
|
private void _CreateAccumulateObjs()
|
|
|
|
|
{
|
|
|
|
|
if (_accumulateDic.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
_accumulateDic.Clear();
|
|
|
|
|
}
|
|
|
|
|
_CreateAccumulateObj(1);
|
|
|
|
|
}
|
2024-04-12 17:18:10 +08:00
|
|
|
|
2023-12-25 18:51:23 +08:00
|
|
|
private void _CreateAccumulateObj(int signId)
|
|
|
|
|
{
|
|
|
|
|
if (!_accumulateDic.ContainsKey(signId))
|
|
|
|
|
{
|
|
|
|
|
var accSignObj = SignObjAccumulate.CreateObj(signId);
|
|
|
|
|
_accumulateDic.Add(signId, accSignObj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-29 14:22:22 +08:00
|
|
|
public async UniTask<bool> CheckShowSignUp()
|
2023-12-25 18:51:23 +08:00
|
|
|
{
|
2024-07-08 13:20:11 +08:00
|
|
|
if (GuideManager.Instance.IsGuiding) // 引导中不弹每日登录奖励
|
|
|
|
|
return false;
|
|
|
|
|
|
2024-02-28 19:30:02 +08:00
|
|
|
if (_accumulateDic.Count > 0)
|
2024-04-29 14:22:22 +08:00
|
|
|
return false;
|
2024-04-12 17:18:10 +08:00
|
|
|
|
2023-12-25 18:51:23 +08:00
|
|
|
_CreateSignObjs();
|
2024-04-12 17:18:10 +08:00
|
|
|
|
2024-04-16 16:50:49 +08:00
|
|
|
if (_accumulateDic[1].IsNeedToShow)
|
2024-04-29 14:22:22 +08:00
|
|
|
{
|
2024-03-29 12:30:23 +08:00
|
|
|
await UI_DailyBonusController.Open(1);
|
2024-04-29 14:22:22 +08:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
2024-02-28 15:10:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public SignObjAccumulate GetAccumulateSignObj(int signId)
|
|
|
|
|
{
|
|
|
|
|
if (_accumulateDic.TryGetValue(signId, out var obj))
|
|
|
|
|
{
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
2023-12-25 18:51:23 +08:00
|
|
|
}
|
2023-12-22 15:27:48 +08:00
|
|
|
}
|