71 lines
1.5 KiB
C#
71 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
using Cysharp.Threading.Tasks;
|
|
using Framework;
|
|
using Gameplay;
|
|
using PhxhSDK;
|
|
using Unity.Mathematics;
|
|
using Constants = PhxhSDK.Constants;
|
|
|
|
public class SignUpManager : Singlenton<SignUpManager>, IInitable
|
|
{
|
|
private Dictionary<int, SignObjAccumulate> _accumulateDic;
|
|
|
|
public void Init()
|
|
{
|
|
_accumulateDic = new Dictionary<int, SignObjAccumulate>();
|
|
}
|
|
|
|
public void Release()
|
|
{
|
|
}
|
|
|
|
private void _CreateSignObjs()
|
|
{
|
|
_CreateAccumulateObjs();
|
|
}
|
|
|
|
//创建累计充值的对象
|
|
private void _CreateAccumulateObjs()
|
|
{
|
|
if (_accumulateDic.Count > 0)
|
|
{
|
|
_accumulateDic.Clear();
|
|
}
|
|
_CreateAccumulateObj(1);
|
|
}
|
|
|
|
private void _CreateAccumulateObj(int signId)
|
|
{
|
|
if (!_accumulateDic.ContainsKey(signId))
|
|
{
|
|
var accSignObj = SignObjAccumulate.CreateObj(signId);
|
|
_accumulateDic.Add(signId, accSignObj);
|
|
}
|
|
}
|
|
|
|
public async UniTask<bool> CheckShowSignUp()
|
|
{
|
|
if (_accumulateDic.Count > 0)
|
|
return false;
|
|
|
|
_CreateSignObjs();
|
|
|
|
if (_accumulateDic[1].IsNeedToShow)
|
|
{
|
|
await UI_DailyBonusController.Open(1);
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public SignObjAccumulate GetAccumulateSignObj(int signId)
|
|
{
|
|
if (_accumulateDic.TryGetValue(signId, out var obj))
|
|
{
|
|
return obj;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
} |