| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Saturday, November 25, 2017 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using TableConfig; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | //关于任务的提升面板 |
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | | public class HoistingWin : Window |
| | | { |
| | | [SerializeField] Transform Content; |
| | | [SerializeField] Button FairyLandButton;//仙界秘境; |
| | | [SerializeField] Button WorldBossButton;//世界Boss按钮 |
| | | [SerializeField] Button PrayerButton;//祈愿 |
| | | [SerializeField] Button BountyTaskButton;//赏金 |
| | | [SerializeField] Button HangUpButton;//挂机 |
| | | private int number = 0; |
| | | DungeonModel m_DungeonModel; |
| | | DungeonModel dungeonModel { get { return m_DungeonModel ?? (m_DungeonModel = ModelCenter.Instance.GetModel<DungeonModel>()); } } |
| | | |
| | | TreasureModel m_Model; |
| | | TreasureModel model { get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<TreasureModel>()); } } |
| | | |
| | | PlayerTaskDatas m_TaskModel; |
| | | PlayerTaskDatas taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<PlayerTaskDatas>()); } } |
| | | |
| | | WorldBossModel Worldmodel { get { return ModelCenter.Instance.GetModel<WorldBossModel>(); } } |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | FairyLandButton.AddListener(() => |
| | | { |
| | | Close(); |
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.DailyQuestFunc1); |
| | | |
| | | }); |
| | | PrayerButton.AddListener(() => |
| | | { |
| | | Close(); |
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.WelfareFunc2); |
| | | }); |
| | | BountyTaskButton.AddListener(() => |
| | | { |
| | | Close(); |
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.DailyQuestFunc1); |
| | | |
| | | }); |
| | | HangUpButton.AddListener(() => |
| | | { |
| | | Close(); |
| | | var mapModel = ModelCenter.Instance.GetModel<MapModel>(); |
| | | var point = mapModel.GetRecommendHangPoint(); |
| | | var config = ConfigManager.Instance.GetTemplate<MapEventPointConfig>(point); |
| | | MapTransferUtility.Instance.MoveToNPC(config.NPCID); |
| | | }); |
| | | WorldBossButton.AddListener(() => { |
| | | Close(); |
| | | WindowCenter.Instance.Open<FindPreciousFrameWin>(); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | number = 0; |
| | | Content.gameObject.SetActive(true); |
| | | |
| | | DungeonRecord dungeonRecord; |
| | | dungeonModel.TryGetDungeonRecord(31080, out dungeonRecord); |
| | | var times = dungeonRecord == null ? 0 : dungeonRecord.enterTimes; |
| | | if (FuncOpen.Instance.IsFuncOpen(86) && dungeonModel.GetDungeonTotalTimes(31080) > times)//仙界秘境 |
| | | { |
| | | FairyLandButton.gameObject.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | FairyLandButton.gameObject.SetActive(false); |
| | | } |
| | | if (FuncOpen.Instance.IsFuncOpen(21) && GeneralConfig.Instance.bossWearyValues[0] + Worldmodel.extraBossWearyValue > Worldmodel.wearyValue) |
| | | { |
| | | WorldBossButton.gameObject.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | WorldBossButton.gameObject.SetActive(false); |
| | | } |
| | | if (FuncOpen.Instance.IsFuncOpen(60) && ModelCenter.Instance.GetModel<PrayerModel>().expPrayerCnt < ModelCenter.Instance.GetModel<PrayerModel>().GetAllExpPrayCnt())//祈愿 |
| | | { |
| | | PrayerButton.gameObject.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | PrayerButton.gameObject.SetActive(false); |
| | | } |
| | | |
| | | if (FuncOpen.Instance.IsFuncOpen(34))//赏金 |
| | | { |
| | | bool _bool = false; |
| | | foreach (var value in taskmodel.SpecialTask.Values) |
| | | { |
| | | if (value.Type == 13 && value.MissionState != 0 && value.MissionState != 3) |
| | | { |
| | | _bool = true; |
| | | } |
| | | } |
| | | foreach (var value in taskmodel.BountyDic.Values) |
| | | { |
| | | if (value.MissionState != 0 && value.MissionState != 3) |
| | | { |
| | | _bool = true; |
| | | } |
| | | |
| | | } |
| | | |
| | | if (_bool) |
| | | { |
| | | BountyTaskButton.gameObject.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | BountyTaskButton.gameObject.SetActive(false); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | BountyTaskButton.gameObject.SetActive(false); |
| | | } |
| | | |
| | | |
| | | if (FuncOpen.Instance.IsFuncOpen(40))//挂机 |
| | | { |
| | | HangUpButton.gameObject.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | HangUpButton.gameObject.SetActive(false); |
| | | } |
| | | |
| | | for (int i = 0; i < Content.childCount; i++) |
| | | { |
| | | |
| | | if (Content.GetChild(i).gameObject.activeSelf) |
| | | { |
| | | number += 1; |
| | | } |
| | | |
| | | } |
| | | if (number <= 0) |
| | | { |
| | | Content.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | if (number <= 0) |
| | | { |
| | | Close(); |
| | | } |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Saturday, November 25, 2017
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | //关于任务的提升面板
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class HoistingWin : Window
|
| | | {
|
| | | [SerializeField] Transform Content;
|
| | | [SerializeField] Button FairyLandButton;//仙界秘境;
|
| | | [SerializeField] Button WorldBossButton;//世界Boss按钮
|
| | | [SerializeField] Button PrayerButton;//祈愿
|
| | | [SerializeField] Button BountyTaskButton;//赏金
|
| | | [SerializeField] Button HangUpButton;//挂机
|
| | | private int number = 0;
|
| | | DungeonModel m_DungeonModel;
|
| | | DungeonModel dungeonModel { get { return m_DungeonModel ?? (m_DungeonModel = ModelCenter.Instance.GetModel<DungeonModel>()); } }
|
| | |
|
| | | TreasureModel m_Model;
|
| | | TreasureModel model { get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<TreasureModel>()); } }
|
| | |
|
| | | PlayerTaskDatas m_TaskModel;
|
| | | PlayerTaskDatas taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<PlayerTaskDatas>()); } }
|
| | |
|
| | | WorldBossModel Worldmodel { get { return ModelCenter.Instance.GetModel<WorldBossModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | FairyLandButton.AddListener(() =>
|
| | | {
|
| | | Close();
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.DailyQuestFunc1);
|
| | |
|
| | | });
|
| | | PrayerButton.AddListener(() =>
|
| | | {
|
| | | Close();
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.WelfareFunc2);
|
| | | });
|
| | | BountyTaskButton.AddListener(() =>
|
| | | {
|
| | | Close();
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.DailyQuestFunc1);
|
| | |
|
| | | });
|
| | | HangUpButton.AddListener(() =>
|
| | | {
|
| | | Close();
|
| | | var mapModel = ModelCenter.Instance.GetModel<MapModel>();
|
| | | var point = mapModel.GetRecommendHangPoint();
|
| | | var config = Config.Instance.Get<MapEventPointConfig>(point);
|
| | | MapTransferUtility.Instance.MoveToNPC(config.NPCID);
|
| | | });
|
| | | WorldBossButton.AddListener(() => {
|
| | | Close();
|
| | | WindowCenter.Instance.Open<FindPreciousFrameWin>();
|
| | | });
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | number = 0;
|
| | | Content.gameObject.SetActive(true);
|
| | | |
| | | DungeonRecord dungeonRecord;
|
| | | dungeonModel.TryGetDungeonRecord(31080, out dungeonRecord);
|
| | | var times = dungeonRecord == null ? 0 : dungeonRecord.enterTimes;
|
| | | if (FuncOpen.Instance.IsFuncOpen(86) && dungeonModel.GetDungeonTotalTimes(31080) > times)//仙界秘境
|
| | | {
|
| | | FairyLandButton.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | FairyLandButton.gameObject.SetActive(false);
|
| | | }
|
| | | if (FuncOpen.Instance.IsFuncOpen(21) && GeneralConfig.Instance.bossWearyValues[0] + Worldmodel.extraBossWearyValue > Worldmodel.wearyValue)
|
| | | {
|
| | | WorldBossButton.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | WorldBossButton.gameObject.SetActive(false);
|
| | | }
|
| | | if (FuncOpen.Instance.IsFuncOpen(60) && ModelCenter.Instance.GetModel<PrayerModel>().expPrayerCnt < ModelCenter.Instance.GetModel<PrayerModel>().GetAllExpPrayCnt())//祈愿
|
| | | {
|
| | | PrayerButton.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | PrayerButton.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | if (FuncOpen.Instance.IsFuncOpen(34))//赏金
|
| | | {
|
| | | bool _bool = false;
|
| | | foreach (var value in taskmodel.SpecialTask.Values)
|
| | | {
|
| | | if (value.Type == 13 && value.MissionState != 0 && value.MissionState != 3)
|
| | | {
|
| | | _bool = true;
|
| | | }
|
| | | }
|
| | | foreach (var value in taskmodel.BountyDic.Values)
|
| | | {
|
| | | if (value.MissionState != 0 && value.MissionState != 3)
|
| | | {
|
| | | _bool = true;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | if (_bool)
|
| | | {
|
| | | BountyTaskButton.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | BountyTaskButton.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | BountyTaskButton.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | |
|
| | | if (FuncOpen.Instance.IsFuncOpen(40))//挂机
|
| | | {
|
| | | HangUpButton.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | HangUpButton.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | for (int i = 0; i < Content.childCount; i++)
|
| | | {
|
| | |
|
| | | if (Content.GetChild(i).gameObject.activeSelf)
|
| | | {
|
| | | number += 1;
|
| | | }
|
| | |
|
| | | }
|
| | | if (number <= 0)
|
| | | {
|
| | | Content.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | if (number <= 0)
|
| | | {
|
| | | Close();
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|