| | |
| | | }
|
| | |
|
| | | bool m_CorrectClose = false;
|
| | | bool rightSelect = true;
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | rightSelect = true;
|
| | | UI3DTreasureSelectStage.Instance.SelectTreasureCategory(TreasureCategory.Human);
|
| | | UpdateButtonState();
|
| | | });
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | rightSelect = true;
|
| | | UI3DTreasureSelectStage.Instance.SelectTreasureCategory(TreasureCategory.Demon);
|
| | | UpdateButtonState();
|
| | | });
|
| | |
| | | CloseImmediately();
|
| | | UI3DTreasureSelectStage.Instance.Close();
|
| | | });
|
| | | m_HumanBtn.repeatClickFunc += () =>
|
| | | {
|
| | | ReclickSelect(TreasureCategory.Human);
|
| | | };
|
| | | m_DemonBtn.repeatClickFunc += () =>
|
| | | {
|
| | | ReclickSelect(TreasureCategory.Demon);
|
| | | };
|
| | | m_FairyBtn.repeatClickFunc += () =>
|
| | | {
|
| | | ReclickSelect(TreasureCategory.Fairy);
|
| | | };
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | UpdateButtonSelect();
|
| | | UpdateButtonState();
|
| | | m_CorrectClose = false;
|
| | | rightSelect = true;
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | |
| | | }, 1.5f);
|
| | | }
|
| | | }
|
| | |
|
| | | private void ReclickSelect(TreasureCategory category)
|
| | | {
|
| | | if (UI3DTreasureSelectStage.Instance.jumping
|
| | | || UI3DTreasureSelectStage.Instance.UnlockShowing || UI3DTreasureSelectStage.Instance.IsCloser
|
| | | || UI3DTreasureSelectStage.Instance.treasureFinishShowing)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var list = model.GetTreasureCategory(category);
|
| | | var gotoId = 0;
|
| | | switch (category)
|
| | | {
|
| | | case TreasureCategory.Human:
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | Treasure treasure;
|
| | | if (model.TryGetTreasure(list[i], out treasure))
|
| | | {
|
| | | var humanTreasure = treasure as HumanTreasure;
|
| | | if (treasure.achievementRedpoint.state == RedPointState.Simple
|
| | | || treasure.skillLevelUpRedpoint.state == RedPointState.Simple
|
| | | || humanTreasure.castSoulRedpoint.state == RedPointState.Simple
|
| | | || humanTreasure.humanState == HumanTreasureState.Challenge)
|
| | | {
|
| | | if (list[i] > UI3DTreasureSelectStage.Instance.selectTreasure)
|
| | | {
|
| | | if (rightSelect || gotoId == 0)
|
| | | {
|
| | | gotoId = list[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | else if (list[i] < UI3DTreasureSelectStage.Instance.selectTreasure)
|
| | | {
|
| | | gotoId = list[i];
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | break;
|
| | | case TreasureCategory.Demon:
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | TreasureDungeon treasureDungeon;
|
| | | if (model.TryGetTreasureDungeon(list[i], out treasureDungeon))
|
| | | {
|
| | | if (treasureDungeon.challengeRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | if (list[i] > UI3DTreasureSelectStage.Instance.selectTreasure)
|
| | | {
|
| | | if (rightSelect || gotoId == 0)
|
| | | {
|
| | | gotoId = list[i];
|
| | | break;
|
| | | }
|
| | | }
|
| | | else if (list[i] < UI3DTreasureSelectStage.Instance.selectTreasure)
|
| | | {
|
| | | gotoId = list[i];
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | if (gotoId != 0)
|
| | | {
|
| | | rightSelect = gotoId > UI3DTreasureSelectStage.Instance.selectTreasure;
|
| | | UI3DTreasureSelectStage.Instance.Goto(list.IndexOf(gotoId));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|