| | |
| | | |
| | | public class DayMissionCell : CellView |
| | | { |
| | | [SerializeField] ItemCell[] itemCells; |
| | | [SerializeField] Transform[] gotRects; |
| | | [SerializeField] Text titleText; |
| | | [SerializeField] Text valueText; |
| | | [SerializeField] Image processImg; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] Button getBtn; |
| | |
| | | int id = DayMissionManager.Instance.dailyIDList[index]; |
| | | var config = DailyTaskConfig.Get(id); |
| | | titleText.text = string.Format(config.Title, config.NeedValue); |
| | | valueText.text = config.AwardLiveness.ToString(); |
| | | var process = DayMissionManager.Instance.GetDailyTaskProcess(id); |
| | | processImg.fillAmount = (float)process / config.NeedValue; |
| | | processText.text = Math.Min(process, config.NeedValue) + "/" + config.NeedValue; |
| | |
| | | getBtn.SetActive(false); |
| | | gotoBtn.SetActive(true); |
| | | gotRect.SetActive(false); |
| | | mask.SetActive(true); |
| | | gotoBtn.AddListener(()=> |
| | | mask.SetActive(false); |
| | | gotoBtn.AddListener(() => |
| | | { |
| | | RightFuncInHome.RemoveListenWindow(); |
| | | UIManager.Instance.CloseWindow<DayMissionBaseWin>(); |
| | |
| | | gotoBtn.SetActive(false); |
| | | gotRect.SetActive(false); |
| | | mask.SetActive(false); |
| | | getBtn.AddListener(()=> |
| | | getBtn.AddListener(() => |
| | | { |
| | | var pack = new CA504_tagCMPlayerGetReward(); |
| | | pack.RewardType = 1; |
| | |
| | | gotRect.SetActive(true); |
| | | mask.SetActive(true); |
| | | } |
| | | |
| | | for (int i = 0; i < itemCells.Length; i++) |
| | | { |
| | | if (i < config.AwardItemList.Length) |
| | | { |
| | | itemCells[i].SetActive(true); |
| | | int itemID = config.AwardItemList[i][0]; |
| | | itemCells[i].Init(new ItemCellModel(config.AwardItemList[i][0], false, config.AwardItemList[i][1])); |
| | | itemCells[i].button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | }); |
| | | gotRects[i].SetActive(state == 2); |
| | | } |
| | | else |
| | | { |
| | | itemCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |