处理快捷键报错
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using NBC;
|
||||
using NBC.Entitas;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
@@ -18,6 +19,8 @@ namespace NBF.Fishing2
|
||||
{
|
||||
Items.AddRange(response.Items);
|
||||
Rigs.AddRange(response.Rigs);
|
||||
Log.Debug(
|
||||
$"获取背包数据成功!Items={JsonConvert.SerializeObject(Items)} Rigs={JsonConvert.SerializeObject(Rigs)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
using UIPanel = NBC.UIPanel;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
@@ -13,6 +14,12 @@ namespace NBF
|
||||
private List<TabItemData> _tabList = new List<TabItemData>();
|
||||
private TabItemData _currentTab;
|
||||
|
||||
public void SetPanel(UIPanel panel)
|
||||
{
|
||||
Menu.SetPanel(panel);
|
||||
SubMenu.SetPanel(panel);
|
||||
}
|
||||
|
||||
private void OnInited()
|
||||
{
|
||||
Menu.OnTabChange += ChangeTab;
|
||||
@@ -55,8 +62,10 @@ namespace NBF
|
||||
|
||||
private void ChangeTab(int index)
|
||||
{
|
||||
if (index < 0) return;
|
||||
var tabListData = _tabList[index];
|
||||
_currentTab = tabListData;
|
||||
var id1 = this.GetHashCode();
|
||||
if (style.selectedIndex == 0)
|
||||
{
|
||||
//只有一级菜单
|
||||
@@ -70,6 +79,12 @@ namespace NBF
|
||||
|
||||
private void ChangeSubTab(int index)
|
||||
{
|
||||
if (index < 0) return;
|
||||
if (_currentTab == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var subList = _currentTab.Children[index];
|
||||
List.SetListData(subList.Items);
|
||||
}
|
||||
|
||||
@@ -5,12 +5,19 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
using UIPanel = NBC.UIPanel;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class CommonMenu : GLabel
|
||||
{
|
||||
public event Action<int> OnTabChange;
|
||||
private UIPanel _panel;
|
||||
|
||||
public void SetPanel(UIPanel panel)
|
||||
{
|
||||
_panel = panel;
|
||||
}
|
||||
|
||||
private void OnInited()
|
||||
{
|
||||
@@ -21,6 +28,7 @@ namespace NBF
|
||||
Game.Input.OnUICanceled += OnUICanceled;
|
||||
}
|
||||
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
Game.Input.OnUICanceled -= OnUICanceled;
|
||||
@@ -29,6 +37,9 @@ namespace NBF
|
||||
|
||||
private void OnUICanceled(string action)
|
||||
{
|
||||
if (_panel == null) return;
|
||||
if (!_panel.IsShowing) return;
|
||||
if (!_panel.IsTop) return;
|
||||
if (action == InputDef.UI.Prev)
|
||||
{
|
||||
OnClickBtnPrev();
|
||||
|
||||
@@ -5,12 +5,19 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using NBC;
|
||||
using UIPanel = NBC.UIPanel;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class CommonSubMenu : GComponent
|
||||
{
|
||||
public event Action<int> OnTabChange;
|
||||
private UIPanel _panel;
|
||||
|
||||
public void SetPanel(UIPanel panel)
|
||||
{
|
||||
_panel = panel;
|
||||
}
|
||||
|
||||
private void OnInited()
|
||||
{
|
||||
@@ -29,6 +36,10 @@ namespace NBF
|
||||
|
||||
private void OnUICanceled(string action)
|
||||
{
|
||||
if (_panel == null) return;
|
||||
if (!_panel.IsShowing) return;
|
||||
if (!_panel.IsTop) return;
|
||||
|
||||
if (action == InputDef.UI.SubPrev)
|
||||
{
|
||||
OnClickBtnPrev();
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace NBF
|
||||
tabItemList.Add(tabItem);
|
||||
}
|
||||
|
||||
ItemList.SetPanel(this);
|
||||
ItemList.SetData(tabItemList, true, true);
|
||||
}
|
||||
|
||||
@@ -73,7 +74,7 @@ namespace NBF
|
||||
// if (btn == BtnClose)
|
||||
// {
|
||||
// Hide();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
|
||||
Reference in New Issue
Block a user