Files
back_cantanBuilding/Assets/Scripts/UI/Shop/ChainPackWithProgressData.cs
2026-05-26 16:15:54 +08:00

34 lines
1.3 KiB
C#

using asap.core;
using cfg;
using GameCore;
namespace GameCore
{
public partial class FishingEventData
{
public readonly ChainPackWithProgressMigrationData ChainPackWithProgressMigrationData = new ChainPackWithProgressMigrationData();
}
}
public class ChainPackWithProgressMigrationData : ThanksGivingPackData
{
public new const string Key = "ThanksGivingPackMigrationData";
public override string RedPointKey => "thanks_giving";
protected override string key => Key;
public void UpdateData(int eventId, int packId)
{
// Debug.Log($"<color=#f18c0a>Updatedata {e.ID}, {e.RedirectID}, {TokenProgress}, {ChainProgress}</color>");
if (eventId == 0 || packId == 0)
return;
var oldData = GContext.container.Resolve<FishingEventData>().ThanksGivingPackData;
if (!GContext.container.Resolve<Tables>().TbFishingEvent.DataMap.ContainsKey(oldData.EventId)
&& oldData.PackId == packId)
{
_data = new Data(eventId: eventId, redirectId: packId, tokenProgress: oldData.TokenProgress, chainProgress: oldData.ChainProgress);
PlayFabMgr.Instance.UpdateUserDataValue(ThanksGivingPackData.Key, "");
}
else
_data = new Data(eventId: eventId, redirectId: packId, tokenProgress: 0, chainProgress: 0);
}
}