101 lines
3.0 KiB
C#
101 lines
3.0 KiB
C#
using UnityEngine;
|
|
using System.Collections;
|
|
using UnityEngine.UI;
|
|
using GCGame.Table;
|
|
using System.Collections.Generic;
|
|
|
|
// 进阶界面统一管理
|
|
public class AdvanceMountPanelCtr : AdvanceBase {
|
|
|
|
public Image titleIcon; // 标题图标,如“坐骑”,“翅膀”
|
|
public List<Sprite> titleIcoList = new List<Sprite>(); // 预存的各个进阶项的标题图标Sprite
|
|
|
|
public static new AdvanceMountPanelCtr Instance;
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
Instance = null;
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
UIManager.ShowUI(UIInfo.MoneyInfoPanel);
|
|
}
|
|
|
|
// 入口
|
|
public void SetAdvanceType(int type)
|
|
{
|
|
m_AdvanceType = (AdvanceType)type;
|
|
titleIcon.overrideSprite = titleIcoList[type];
|
|
// 表明是第一次打开
|
|
if (!hasOpenUI)
|
|
{
|
|
//menuItemPanelCtr.IntMenuItemDesc();
|
|
menuItemPanelCtr.OnMenuItemClick(AdvanceMenuItemPanelCtr.MenuItemOptType.Show);
|
|
}
|
|
}
|
|
|
|
//手机卡的话可能在同一帧内没法处理
|
|
public void ShowAdnvaceFashionPanel()
|
|
{
|
|
StartCoroutine(ShowAdvanceFashionPanel());
|
|
}
|
|
|
|
IEnumerator ShowAdvanceFashionPanel()
|
|
{
|
|
yield return new WaitForEndOfFrame();
|
|
AdvanceMountPanelCtr.Instance.menuItemPanelCtr.OnMenuItemClick(AdvanceMenuItemPanelCtr.MenuItemOptType.Fashion);
|
|
yield return new WaitForEndOfFrame();
|
|
if (AdvanceFashionPanelCtr.Instance && AdvanceFashionPanelCtr.Instance.gameObject.activeInHierarchy)
|
|
{
|
|
AdvanceFashionPanelCtr.Instance.isShowIndex = 1;
|
|
AdvanceFashionPanelCtr.Instance.OnToggleClick(1);
|
|
}
|
|
|
|
yield break;
|
|
}
|
|
|
|
public override void OnAdvanceInfoReceive(AdvanceInfo info)
|
|
{
|
|
base.OnAdvanceInfoReceive(info);
|
|
}
|
|
|
|
public override void RefreshItemPanel()
|
|
{
|
|
base.RefreshItemPanel();
|
|
}
|
|
|
|
public override void OnCloseBtnClick()
|
|
{
|
|
base.OnCloseBtnClick();
|
|
//判断是否清空祝福
|
|
if (AdvanceMountPanelCtr.Instance.advancePanel.IsCleanWish()
|
|
&& AdvanceMountPanelCtr.Instance.advancePanel.wishPanel._CurWishValue > 0)
|
|
{
|
|
MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{46225}"), "",delegate (){
|
|
UIManager.CloseUI(UIInfo.MessageBox);
|
|
UIManager.CloseUI(UIInfo.AdvanceMountPanel);
|
|
if (AdvanceCanadvanceCtr.GetInstance() != null)
|
|
{
|
|
AdvanceCanadvanceCtr.Instance.JudgeShowCanAdvanceIcon();
|
|
}
|
|
}, delegate (){
|
|
UIManager.CloseUI(UIInfo.MessageBox);
|
|
return;
|
|
});
|
|
}
|
|
else
|
|
{
|
|
UIManager.CloseUI(UIInfo.AdvanceMountPanel);
|
|
if (AdvanceCanadvanceCtr.GetInstance() != null)
|
|
{
|
|
AdvanceCanadvanceCtr.Instance.JudgeShowCanAdvanceIcon();
|
|
}
|
|
}
|
|
}
|
|
}
|