| | |
| | | [SerializeField] Button m_Challenge;
|
| | | [SerializeField] TextEx m_ChallengeTitle;
|
| | | [SerializeField] ImageEx m_ChallengeImage;
|
| | | [SerializeField] Button m_FlashKill;
|
| | | [SerializeField] Text m_FlashKillCount;
|
| | |
|
| | | [SerializeField] Button m_Rank;
|
| | | [SerializeField] Button m_Gift;
|
| | |
| | |
|
| | | SkyTowerModel model { get { return ModelCenter.Instance.GetModel<SkyTowerModel>(); } }
|
| | | RankModel rankModel { get { return ModelCenter.Instance.GetModel<RankModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | ShowType showType = ShowType.None;
|
| | |
|
| | |
| | | {
|
| | | m_Challenge.SetListener(Challenge);
|
| | | m_ViewBoss.SetListener(() => { DisplayBossInfo(false); });
|
| | | m_ViewReward.SetListener(() => { DisplayRewardInfo(false); });
|
| | | m_ViewReward.SetListener(() => {
|
| | | if (showType == ShowType.Reward)
|
| | | {
|
| | | return;
|
| | | }
|
| | | DisplayRewardInfo(false); });
|
| | | m_Rank.SetListener(() => {
|
| | | rankModel.jumpRankType = 6;
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.GameRank);
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | model.OnFlashOverEvent += OnFlashOverEvent;
|
| | | showType = ShowType.None;
|
| | | model.ConfirmRedpoint02();
|
| | | }
|
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.OnFlashOverEvent -= OnFlashOverEvent;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | Display();
|
| | | }
|
| | |
|
| | | void Display()
|
| | | {
|
| | | DisplayTowerInfo();
|
| | | DisplayChallengeButton();
|
| | | DisplayRewardInfo(false);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | private void OnFlashOverEvent(int state)
|
| | | {
|
| | | if (state == 2)
|
| | | Display();
|
| | | }
|
| | |
|
| | |
|
| | | private void DisplayTowerInfo()
|
| | | {
|
| | |
| | |
|
| | | private void DisplayRewardInfo(bool immediately)
|
| | | {
|
| | | if (showType == ShowType.Reward)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | showType = ShowType.Reward;
|
| | |
|
| | |
| | |
|
| | | private void DisplayChallengeButton()
|
| | | {
|
| | | m_ChallengeTitle.text = Language.Get(model.allPassed ? "SkyTower4" : "Multiple_Challenge");
|
| | | m_ChallengeImage.gray = !model.IsChallengable();
|
| | | int count = GetFlashKillCount();
|
| | | if (count == 0)
|
| | | {
|
| | | m_FlashKill.SetActive(false);
|
| | | m_Challenge.SetActive(true);
|
| | | m_ChallengeTitle.text = Language.Get(model.allPassed ? "SkyTower4" : "Multiple_Challenge");
|
| | | m_ChallengeImage.gray = !model.IsChallengable();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_FlashKill.SetActive(true);
|
| | | m_Challenge.SetActive(false);
|
| | | m_FlashKillCount.text = count == 1 ? string.Empty : count.ToString();
|
| | |
|
| | | m_FlashKill.AddListener(() => {
|
| | |
|
| | | if (!dungeonModel.CanFlashKill())
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("InFBCanotDo");
|
| | | return;
|
| | | }
|
| | |
|
| | | var pack = new CB108_tagCMFBQuickPass();
|
| | | pack.MapID = SkyTowerModel.DATA_MAPID;
|
| | | pack.LineID = (ushort)(model.currentFloor + count - 1);
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | // 前20层不用雷诛
|
| | | int GetFlashKillCount()
|
| | | {
|
| | | int count = 0;
|
| | | if (model.currentFloor <= 20)
|
| | | return count;
|
| | |
|
| | | for (int i = 0; i < GeneralDefine.flashKillMaxCount; i++)
|
| | | { |
| | | var config = SkyTowerConfig.Get(model.currentFloor + i);
|
| | | if (config == null)
|
| | | break;
|
| | |
|
| | | var fightPower = NPCExConfig.Get(config.bossId).SuppressFightPower;
|
| | | if (PlayerDatas.Instance.baseData.FightPoint >= (ulong)fightPower * GeneralDefine.fightPowerMore)
|
| | | {
|
| | | count++;
|
| | | }
|
| | | else
|
| | | {
|
| | | //遇到第一个卡点就停止
|
| | | break;
|
| | | }
|
| | | }
|
| | | return count;
|
| | | }
|
| | |
|
| | | private void Challenge()
|