using System; using Cal.DataTable; namespace ET { public class ActiveComponentAwakeSystem: AwakeSystem { public override void Awake(ActiveComponent self) { ActiveComponent.instance = self; } } public static class ActiveComponentSystem { public static bool GetSigninReward(this ActiveComponent self, long id, out SignInRewardConfig config) { if (!self.SignInRewardDic.TryGetValue(id, out int currId)) { self.SignInRewardDic[id] = currId = DateTime.UtcNow.DayOfYear; config = SignInRewardConfigCategory.Instance.GetByDay(currId); return false; } config = SignInRewardConfigCategory.Instance.GetByDay(currId); return true; } public static bool GetOnLineReward(this ActiveComponent self, long id, out OnlineRewardBase config) { if (!self.SignInRewardDic.TryGetValue(id, out int currId)) { self.SignInRewardDic[id] = currId = DateTime.UtcNow.DayOfYear; config = OnlineRewardBaseCategory.Instance.Get(currId); return false; } config = OnlineRewardBaseCategory.Instance.Get(currId); return true; } } }