| | |
| | | //经验区 |
| | | [SerializeField] Text playerLevelText; |
| | | [SerializeField] SmoothSlider expSlider; |
| | | [SerializeField] Button officialUpBtn; |
| | | |
| | | //任务区 |
| | | [SerializeField] Button taskButton; //引导或者领取任务奖励 |
| | |
| | | |
| | | [SerializeField] Button changeHeroPosBtn; |
| | | |
| | | //等级 |
| | | [SerializeField] Button officialUpBtn; |
| | | |
| | | //卡牌 |
| | | [SerializeField] HeroFightingCardCell[] heroFightingCardCells; |
| | | |
| | | //底部功能 |
| | | [SerializeField] Button autoBtn; |
| | | [SerializeField] Image autoCloseImg; |
| | | [SerializeField] UIEffectPlayer autoOpenEffect; |
| | | [SerializeField] Button blessLVBtn; |
| | | [SerializeField] Button blessLVBtn; |
| | | [SerializeField] Text blessLVText; |
| | | |
| | | //其他功能入口 |
| | |
| | | UIManager.Instance.OpenWindow<BlessLVWin>(); |
| | | }); |
| | | |
| | | officialUpBtn.AddListener(()=> |
| | | officialUpBtn.AddListener(() => |
| | | { |
| | | if (RealmConfig.GetKeys().Count <= PlayerDatas.Instance.baseData.realmLevel) |
| | | return; |
| | |
| | | RefreshRecharge(); |
| | | ShowBlessLV(); |
| | | DisplayAutoFight(); |
| | | DisplayCard(TeamType.Story); |
| | | |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | |
| | | TaskManager.Instance.OnTaskUpdate += UpdateTask; |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent += ShowBlessLV; |
| | | AutoFightModel.Instance.ChangeAutoEvent += DisplayAutoFight; |
| | | TeamManager.Instance.OnTeamChange += DisplayCard; |
| | | UIManager.Instance.OnCloseWindow += OnCloseWindow; |
| | | Display(); |
| | | // var battleWin = UIManager.Instance.OpenWindow<BattleWin>(); |
| | | // battleWin.SetBattleField(BattleManager.Instance.storyBattleField); |
| | |
| | | TaskManager.Instance.OnTaskUpdate -= UpdateTask; |
| | | BlessLVManager.Instance.OnBlessLVUpdateEvent -= ShowBlessLV; |
| | | AutoFightModel.Instance.ChangeAutoEvent -= DisplayAutoFight; |
| | | TeamManager.Instance.OnTeamChange -= DisplayCard; |
| | | UIManager.Instance.OnCloseWindow -= OnCloseWindow; |
| | | |
| | | // 关闭的时候把战斗界面也给关了 虽然是在外面开的 |
| | | UIManager.Instance.CloseWindow<BattleWin>(); |
| | |
| | | } |
| | | |
| | | void RefreshRecharge() |
| | | { |
| | | { |
| | | monthCardBtn.SetActive(!InvestModel.Instance.IsInvested(InvestModel.monthCardType)); |
| | | } |
| | | |
| | |
| | | autoOpenEffect.Stop(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 更新玩家信息 |
| | | /// </summary> |
| | |
| | | |
| | | |
| | | void UpdateTask() |
| | | { |
| | | { |
| | | var task = TaskManager.Instance.mainTask; |
| | | if (task.TaskID == 0) |
| | | { |
| | |
| | | var taskConfig = TaskConfig.Get(task.TaskID); |
| | | taskText.text = taskConfig.TaskDescribe; |
| | | taskNumText.text = string.Format("({0}/{1})", task.CurValue, taskConfig.NeedValue); |
| | | taskNumText.color = task.CurValue >= taskConfig.NeedValue ? UIHelper.GetUIColor(TextColType.NavyYellow) : UIHelper.GetUIColor(TextColType.Red); |
| | | taskNumText.color = task.CurValue >= taskConfig.NeedValue ? UIHelper.GetUIColor(TextColType.NavyYellow) : UIHelper.GetUIColor(TextColType.Red); |
| | | if (TaskManager.Instance.GetMainTaskState() == 2) |
| | | { |
| | | { |
| | | taskEffect.Play(); |
| | | } |
| | | else |
| | |
| | | //根据任务类型引导 |
| | | } |
| | | } |
| | | |
| | | void DisplayCard(TeamType teamType) |
| | | { |
| | | if (teamType != TeamType.Story) |
| | | return; |
| | | //显示卡牌 |
| | | for (int i = 0; i < heroFightingCardCells.Length; i++) |
| | | { |
| | | heroFightingCardCells[i].Display(i); |
| | | } |
| | | } |
| | | |
| | | private void OnCloseWindow(UIBase closeUI) |
| | | { |
| | | //其他武将功能产生数据变化,需要刷新武将列表 |
| | | if (closeUI is HeroTrainWin) |
| | | { |
| | | DisplayCard(TeamType.Story); |
| | | } |
| | | } |
| | | } |