Example #1
0
 public void InitData()
 {
     dailyReward   = LoadResourceController.GetDailyRewardDataCollection();
     dataPlayer    = GameMgr.Ins.dataPlayer.playerDailyReward;
     dataMoney     = GameMgr.Ins.dataPlayer.playerMoney;
     currentDay    = dataPlayer.GetCurrentDay();
     dataCondition = dataPlayer.GetDailyRewardElementData();
     timeView      = Instantiate(timeView, timeViewParents);
 }
    public void OnClickClaim()
    {
        rewardList.Clear();
        for (int i = 0; i < playerDailyReward.GetCurrentDay(); i++)
        {
            if (!dailyRewardViews[i].IsReceived())
            {
                dailyRewardViews[i].ClaimReward();
                rewardList.AddRange(dailyRewardViews[i].GetRewards());
            }
        }

        if (rewardList.Count == 0)
        {
            return;
        }

        WindowManager.Instance.ShowWindowWithData(WindowType.UI_SHOW_REWARD, Reward.FixDuplicateRewards(rewardList));
    }
Example #3
0
 public bool IsReceivable()
 {
     SetupController();
     return(id <= playerDailyReward.GetCurrentDay());
 }