备份CatanBuilding瘦身独立工程
This commit is contained in:
94
Assets/Scripts/DataCenter/FishingEventData_OneOne.cs
Normal file
94
Assets/Scripts/DataCenter/FishingEventData_OneOne.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using LitJson;
|
||||
using System;
|
||||
namespace GameCore
|
||||
{
|
||||
public partial class FishingEventData
|
||||
{
|
||||
string Pack1A1DataKey = "Pack1A1Data";
|
||||
public TriggerPackBuyData Pack1A1Data;
|
||||
bool isFace;
|
||||
void GiftFace1A1(int packType, int eventID)
|
||||
{
|
||||
if (isFace)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Pack1A1Data == null || Pack1A1Data.index < 2 || Pack1A1Data.lastID != eventID)
|
||||
{
|
||||
GContext.container.Resolve<IFaceUIService>().AddGiftFaceUI(eventID, UITypes.GiftPopupPanel_10, packType, true);
|
||||
}
|
||||
}
|
||||
public void SetPack1A1(FishingEvent t)
|
||||
{
|
||||
if (Pack1A1Data == null)
|
||||
{
|
||||
string json_duelData = PlayFabMgr.Instance.GetLocalData(Pack1A1DataKey);
|
||||
if (json_duelData != null)
|
||||
{
|
||||
Pack1A1Data = Newtonsoft.Json.JsonConvert.DeserializeObject<TriggerPackBuyData>(json_duelData);
|
||||
}
|
||||
}
|
||||
EventPackManager eventPackDataRead = _tables.TbEventPackManager.DataMap[t.RedirectID];
|
||||
GiftFace1A1(eventPackDataRead.PackType, t.ID);
|
||||
if (Pack1A1Data != null && Pack1A1Data.lastID == t.ID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Pack1A1Data = new TriggerPackBuyData()
|
||||
{
|
||||
ID = eventPackDataRead.ID,
|
||||
lastID = t.ID,//活动id
|
||||
index = 0,
|
||||
vipLevel = GContext.container.Resolve<PlayerData>().PriceLv,
|
||||
mapID = GContext.container.Resolve<PlayerData>().lastMapId,
|
||||
};
|
||||
RedPointManager.Instance.SetRedPointState(HomeBtnOneOnePack.redKey, false);
|
||||
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(Pack1A1DataKey, JsonMapper.ToJson(Pack1A1Data));
|
||||
}
|
||||
public void SetPack1A1Index(int index)
|
||||
{
|
||||
if (Pack1A1Data == null || index < Pack1A1Data.index)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Pack1A1Data.index = index;
|
||||
if (Pack1A1Data.index >= 2)
|
||||
{
|
||||
//购买完 特殊处理
|
||||
GContext.Publish(new TargetEvent(Pack1A1Data.lastID, 3, 8));
|
||||
}
|
||||
RedPointManager.Instance.SetRedPointState(HomeBtnOneOnePack.redKey, Pack1A1Data.index == 1);
|
||||
PlayFabMgr.Instance.UpdateUserDataValue(Pack1A1DataKey, JsonMapper.ToJson(Pack1A1Data));
|
||||
}
|
||||
public int GetPack1A1Index()
|
||||
{
|
||||
isFace = true;
|
||||
if (Pack1A1Data == null)
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
return Pack1A1Data.index;
|
||||
}
|
||||
public EventPackManager Get1A1EventPackManager()
|
||||
{
|
||||
if (Pack1A1Data == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return _tables.TbEventPackManager.DataMap[Pack1A1Data.ID];
|
||||
}
|
||||
public DateTime GetEvent1A1EndTime()
|
||||
{
|
||||
if (Pack1A1Data == null)
|
||||
{
|
||||
return ZZTimeHelper.UtcNow().UtcNowOffset(); ;
|
||||
}
|
||||
return GetEventEndTime(Pack1A1Data.lastID);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user