备份CatanBuilding瘦身独立工程
This commit is contained in:
33
Assets/Scripts/UI/Shop/ChainPackWithProgressData.cs
Normal file
33
Assets/Scripts/UI/Shop/ChainPackWithProgressData.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user