2021-04-08 20:09:59 +08:00
|
|
|
|
using Cal.DataTable;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
public class OnlineRewardComponentAwakeSystem : AwakeSystem<OnlineRewardComponent>
|
|
|
|
|
{
|
|
|
|
|
public override void Awake(OnlineRewardComponent self)
|
|
|
|
|
{
|
|
|
|
|
self.Awake();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public static class OnlineRewardComponentSystem
|
|
|
|
|
{
|
|
|
|
|
public static void Awake(this OnlineRewardComponent self)
|
|
|
|
|
{
|
|
|
|
|
OnlineRewardComponent.instance = self;
|
2021-04-11 19:50:39 +08:00
|
|
|
|
IEnumerable<OnlineRewardBase> list = DataTableHelper.GetAll<OnlineRewardBase>();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
foreach (OnlineRewardBase item in list)
|
|
|
|
|
{
|
|
|
|
|
self.timeList.Add((int)item.Id);
|
|
|
|
|
}
|
|
|
|
|
self.timeList.Sort();
|
|
|
|
|
}
|
|
|
|
|
public static int GetRewardTime(this OnlineRewardComponent self,TimeSpan onlineTime)
|
|
|
|
|
{
|
|
|
|
|
for (int i = self.timeList.Count - 1; i >= 0; i--)
|
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
int time = self.timeList[i];
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (time <= onlineTime.TotalMinutes)
|
|
|
|
|
return time;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|