using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; // 武将功能界面 public class HeroTrainBaseWin : OneLevelWin { protected override void OpenSubUIByTabIndex() { ShowSkinBtn(); switch (functionOrder) { case 0: //培养 if (UIManager.Instance.IsOpened()) { UIManager.Instance.CloseWindow(); } currentSubUI = UIManager.Instance.OpenWindow(); if (GetSortingOrder() < currentSubUI.GetSortingOrder()) { SetSortingOrder(currentSubUI.GetSortingOrder() + 1); } break; case 1: //突破 if (UIManager.Instance.IsOpened()) { UIManager.Instance.CloseWindow(); } currentSubUI = UIManager.Instance.OpenWindow(1); if (GetSortingOrder() < currentSubUI.GetSortingOrder()) { SetSortingOrder(currentSubUI.GetSortingOrder() + 1); } break; case 2: //皮肤 currentSubUI = UIManager.Instance.OpenWindow(); if (GetSortingOrder() < currentSubUI.GetSortingOrder()) { SetSortingOrder(currentSubUI.GetSortingOrder() + 1); } break; default: Debug.LogWarning("未知的标签索引: " + functionOrder); break; } } //有的武将没有皮肤 public void ShowSkinBtn() { if (string.IsNullOrEmpty(HeroUIManager.Instance.selectHeroGuid)) { return; } var config = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuid).heroConfig; tabButtons[2].SetActive(config.SkinIDList.Length > 1); } void LateUpdate() { if (currentSubUI == null) return; if (GetSortingOrder() < currentSubUI.GetSortingOrder()) { SetSortingOrder(currentSubUI.GetSortingOrder() + 1); } } }