处理快捷键报错

This commit is contained in:
2025-10-13 23:10:47 +08:00
parent 9470c3ab00
commit c3284032cc
5 changed files with 42 additions and 1 deletions

View File

@@ -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();