47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
using System.Threading.Tasks;
|
|
using asap.core;
|
|
using cfg;
|
|
using Newtonsoft.Json;
|
|
using UnityEngine;
|
|
|
|
namespace EventMowForTreasure
|
|
{
|
|
public class EventMowForTreasureCollectionData
|
|
{
|
|
public EventMowForTreasureCollectionData(Tables tables,int collectionID,int amount)
|
|
{
|
|
_tables = tables;
|
|
CollectionID=collectionID;
|
|
Amount=amount;
|
|
}
|
|
public int Amount;
|
|
public int Round;
|
|
|
|
public void SetData(EventMowForTreasureCollectionData data)
|
|
{
|
|
Amount=data.Amount;
|
|
Round=data.Round;
|
|
}
|
|
|
|
[JsonIgnore]public int CollectionID;
|
|
[JsonIgnore]private Tables _tables;
|
|
[JsonIgnore] private Tables Tables => _tables??=GContext.container.Resolve<Tables>();
|
|
[JsonIgnore]public EventMowForTreasureCollection CollectionConfig=>Tables.TbEventMowForTreasureCollection.GetOrDefault(CollectionID);
|
|
[JsonIgnore] public bool IsPlayReward;
|
|
|
|
[JsonIgnore] public bool IsRefresh = false;
|
|
[JsonIgnore] public bool IsObtainReward = false;
|
|
|
|
[JsonIgnore] public Task PlayRewardFly;
|
|
|
|
[JsonIgnore] public Vector3 Position;
|
|
|
|
public int GerRewardDropID()
|
|
{
|
|
if (CollectionConfig == null) return 0;
|
|
var configCount = CollectionConfig.CollectingRewardList.Count;
|
|
var round=Round >= configCount?configCount - 1:Round;
|
|
return CollectionConfig?.CollectingRewardList[round]??0;
|
|
}
|
|
}
|
|
} |