| | |
| | | using System; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using Cysharp.Threading.Tasks; |
| | | |
| | | /// <summary> |
| | | /// 游戏主界面底部功能按钮 |
| | |
| | | /// <summary> |
| | | /// 根据标签索引打开对应的子界面 |
| | | /// </summary> |
| | | protected override void OpenSubUIByTabIndex() |
| | | protected override async void OpenSubUIByTabIndex() |
| | | { |
| | | |
| | | Debug.Log("打开子界面 : " + functionOrder); |
| | |
| | | // 打开主页界面 |
| | | if (!UIManager.Instance.IsOpened<BattleWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindowAsync<BattleWin>().ContinueWith(battleWin => |
| | | battleWin.SetBattleField(BattleManager.Instance.storyBattleField)).Forget(); |
| | | BattleWin battleWin = await UIManager.Instance.OpenWindowAsync<BattleWin>(); |
| | | battleWin.SetBattleField(BattleManager.Instance.storyBattleField); |
| | | } |
| | | else |
| | | { |
| | | BattleWin battleWin = UIManager.Instance.GetUI<BattleWin>(); |
| | | battleWin.SetBattleField(BattleManager.Instance.storyBattleField); |
| | | } |
| | | UIManager.Instance.OpenWindowAsync<HomeWin>().ContinueWith(w => currentSubUI = w).Forget(); |
| | | currentSubUI = await UIManager.Instance.OpenWindowAsync<HomeWin>(); |
| | | break; |
| | | case 1: |
| | | UIManager.Instance.OpenWindowAsync<AffairBaseWin>().ContinueWith(w => currentSubUI = w).Forget(); |
| | | currentSubUI = await UIManager.Instance.OpenWindowAsync<AffairBaseWin>(); |
| | | break; |
| | | case 2: |
| | | if (gameTip.gameObject.activeSelf) |
| | |
| | | HappyXBModel.Instance.startTenCallGuide = true; |
| | | } |
| | | } |
| | | UIManager.Instance.OpenWindowAsync<HeroBaseWin>(0).ContinueWith(w => currentSubUI = w).Forget(); |
| | | currentSubUI = await UIManager.Instance.OpenWindowAsync<HeroBaseWin>(0); |
| | | break; |
| | | // case 3: |
| | | // 挑战界面不跳转 |
| | | // Debug.Log("打开挑战界面"); |
| | | // break; |
| | | case 4: |
| | | UIManager.Instance.OpenWindowAsync<GuildBaseWin>().ContinueWith(w => currentSubUI = w).Forget(); |
| | | currentSubUI = await UIManager.Instance.OpenWindowAsync<GuildBaseWin>(); |
| | | break; |
| | | default: |
| | | Debug.LogWarning("未知的标签索引: " + functionOrder); |
| | |
| | | { |
| | | if (nextCantAttackMask.localScale == Vector3.one) |
| | | { |
| | | if (BattleManager.Instance.storyBattleField.IsCanRequestFight()) |
| | | if (BattleManager.Instance.storyBattleField != null && BattleManager.Instance.storyBattleField.IsCanRequestFight()) |
| | | { |
| | | nextCantAttackMask.localScale = Vector3.zero; |
| | | } |