| | |
| | |
|
| | | int roundType;
|
| | | int tabType; |
| | | int mIndex; |
| | | int awardIndex; |
| | | CycleHallActModel model { get { return ModelCenter.Instance.GetModel<CycleHallActModel>(); } }
|
| | |
|
| | | private void OnEnable()
|
| | |
| | | missionTweens[i].Stop();
|
| | | missionTweens[i].SetStartState();
|
| | | }
|
| | | if (tabType == 1)
|
| | |
|
| | | var act = model.GetOperationInfo();
|
| | | if (act == null || !act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex) || awardInfo.AwardItemList == null)
|
| | | return;
|
| | | int state = model.GetAwardState(roundType, awardIndex);
|
| | | for (int i = 0; i < missionTweens.Count; i++)
|
| | | {
|
| | | int state = model.GetAwardState(roundType, mIndex);//0 不可领取 1 可领取 2 已领取
|
| | | for (int i = 0; i < missionTweens.Count; i++)
|
| | | if (i < awardInfo.AwardItemList.Length)
|
| | | {
|
| | | var act = model.GetOperationInfo();
|
| | | if (act == null || !act.TryGetRound(roundType, out var round) || round.AwardList == null || round.AwardList.Length <= mIndex || mIndex < 0)
|
| | | return;
|
| | | var award = round.AwardList[mIndex];
|
| | | if (award.AwardItemList == null)
|
| | | return;
|
| | | if (i < award.AwardItemList.Length)
|
| | | if (state == 1)
|
| | | {
|
| | | if (state == 1)
|
| | | {
|
| | | missionTweens[i].Play();
|
| | | }
|
| | | missionTweens[i].Play();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | |
| | | model.PlayAnimationSync -= OnPlaySyncAnimation;
|
| | | }
|
| | |
|
| | | public void Display(int index, CellView cellView)
|
| | | public void Display(int awardIndex, CellView cellView)
|
| | | {
|
| | | this.mIndex = index;
|
| | | this.awardIndex = awardIndex;
|
| | | roundType = cellView.info.Value.infoInt1;
|
| | | tabType = cellView.info.Value.infoInt2;
|
| | | btnMissionHave.enabled = false;
|
| | | var act = model.GetOperationInfo();
|
| | | if (act == null || !act.TryGetRound(roundType, out var round))
|
| | | return;
|
| | | if (!act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex) || awardInfo.AwardItemList == null)
|
| | | return;
|
| | | if (model.playerInfoDict == null || !model.playerInfoDict.TryGetValue((byte)roundType, out var playerInfo) || playerInfo == null)
|
| | | return;
|
| | |
|
| | | var act = model.GetOperationInfo();
|
| | | if (act == null || !act.TryGetRound(roundType, out var round) || round.AwardList == null || round.AwardList.Length <= index || index < 0)
|
| | | return;
|
| | | var award = round.AwardList[index];
|
| | | int state = model.GetAwardState(roundType, index);//0 不可领取 1 可领取 2 已领取
|
| | | int state = model.GetAwardState(roundType, awardIndex);
|
| | | imgFinish.SetActive(state == 2);
|
| | | txtTitle.text = Language.Get(StringUtility.Contact("CycleHallMissionTitle", "_", round.AwardType, "_", round.AwardTypeValue), award.NeedValue);
|
| | | buyCountGiftSlider.value = playerInfo.CurValue / (float)award.NeedValue;
|
| | | buyCountGiftSliderText.text = string.Format("{0}/{1}", playerInfo.CurValue, award.NeedValue);
|
| | | txtTitle.text = Language.Get(StringUtility.Contact("CycleHallMissionTitle", "_", round.AwardType, "_", round.AwardTypeValue), awardInfo.NeedValue);
|
| | | buyCountGiftSlider.value = playerInfo.CurValue / (float)awardInfo.NeedValue;
|
| | | buyCountGiftSliderText.text = string.Format("{0}/{1}", playerInfo.CurValue, awardInfo.NeedValue);
|
| | | btnMissionHave.enabled = true;
|
| | | btnMissionHave.SetListener(() =>
|
| | | {
|
| | | HaveMissionAward();
|
| | | if (state == 1)
|
| | | {
|
| | | HaveMissionAward();
|
| | | }
|
| | | });
|
| | | for (int i = 0; i < missionItemCells.Count; i++)
|
| | | {
|
| | | var itemBaisc = missionItemCells[i];
|
| | | if (i < award.AwardItemList.Length)
|
| | | if (i < awardInfo.AwardItemList.Length)
|
| | | {
|
| | | var itemInfo = award.AwardItemList[i];
|
| | | var itemInfo = awardInfo.AwardItemList[i];
|
| | | itemBaisc.SetActive(true);
|
| | | missionHaves[i].SetActive(state == 2);
|
| | | missionGreys[i].SetActive(state == 2);
|
| | |
| | | public void HaveMissionAward()
|
| | | {
|
| | | var act = model.GetOperationInfo();
|
| | | if (act == null || !act.TryGetRound(roundType, out var round) || round.AwardList == null || round.AwardList.Length <= mIndex || mIndex < 0)
|
| | | if (act == null || !act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex) || awardInfo.AwardItemList == null)
|
| | | return;
|
| | | int state = model.GetAwardState(roundType, mIndex);//0 不可领取 1 可领取 2 已领取
|
| | | int state = model.GetAwardState(roundType, awardIndex);
|
| | | if (state != 1)
|
| | | return;
|
| | | model.SendGetAward(roundType, (int)round.AwardList[mIndex].NeedValue);
|
| | | model.SendGetAward(roundType, (int)awardInfo.NeedValue);
|
| | | }
|
| | |
|
| | | private void OnPlaySyncAnimation()
|
| | |
| | | missionTweens[i].Stop();
|
| | | missionTweens[i].SetStartState();
|
| | | }
|
| | | int state = model.GetAwardState(roundType, mIndex);//0 不可领取 1 可领取 2 已领取
|
| | | var act = model.GetOperationInfo();
|
| | | if (act == null || !act.TryGetRoundInfoByIndex(roundType, awardIndex, out var awardInfo, out int listIndex) || awardInfo.AwardItemList == null)
|
| | | return;
|
| | | int state = model.GetAwardState(roundType, awardIndex);
|
| | | for (int i = 0; i < missionTweens.Count; i++)
|
| | | {
|
| | | if (missionTweens[i].isActiveAndEnabled && state == 1)
|