| | |
| | | [SerializeField] GameObject bgObj;
|
| | |
|
| | | SetPrivateModel privateModel { get { return ModelCenter.Instance.GetModel<SetPrivateModel>(); } }
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | |
|
| | | public void SetModel(int dailyId)
|
| | | {
|
| | | string title = "";
|
| | | string weekDay = "";
|
| | | string openTime = "";
|
| | | privateModel.GetDailyInfoById(dailyId,out title,out weekDay,out openTime);
|
| | | privateModel.GetDailyInfoById(dailyId, out title, out weekDay, out openTime);
|
| | | nameText.text = title;
|
| | | weekDayText.text = weekDay;
|
| | | timeText.text = openTime;
|
| | | int index = privateModel.GetSwitchIndexById(dailyId);
|
| | | pushBtn.SetInit(index,privateModel.GetSwitchStateByIndex(index));
|
| | | pushBtn.switchBtn.RemoveAllListeners();
|
| | | pushBtn.switchBtn.AddListener(() =>
|
| | |
|
| | | var quests = dailyQuestModel.GetDailyQuests(DailyQuestModel.DailyQuestCategory.TimeLimit);
|
| | | int index = privateModel.GetSwitchIndexById(dailyId, quests);
|
| | | pushBtn.SetInit(index, privateModel.GetSwitchStateByIndex(index));
|
| | | pushBtn.switchBtn.SetListener(() =>
|
| | | {
|
| | | if (pushBtn.onObj.activeInHierarchy)
|
| | | {
|
| | |
| | | }
|
| | | });
|
| | |
|
| | | if(this.index % 2 == 0)
|
| | | {
|
| | | bgObj.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | bgObj.SetActive(false);
|
| | | }
|
| | | bgObj.SetActive(this.index % 2 == 0);
|
| | | }
|
| | | }
|
| | | }
|