fix not open skill UI when click on empty quick bar slot

This commit is contained in:
Chomper9981
2026-03-13 10:38:51 +07:00
parent 34e5b569ed
commit 67acf39b7a
2 changed files with 11 additions and 3 deletions
@@ -58,6 +58,7 @@ namespace BrewMonster
}
public CECSkill GetSkill() { return m_pSkill; }
public void SetSkill(CECSkill pSkill) { m_pSkill = pSkill; }
public override string GetDesc() { return m_pSkill.GetSkillID().ToString(); }
}
}
@@ -13,17 +13,20 @@ namespace BrewMonster
[SerializeField] private SkillUI skillUI;
bool m_bOpenAction;
bool m_bReceivedNCPGreeting; // ÊÇ·ñÊÕµ½ÁËNPCµÄGreeting
bool m_bReceivedNCPGreeting; // ǷյNPCGreeting
public override void Awake()
{
base.Awake();
uiSkillButton.onClick.RemoveAllListeners();
uiSkillButton.onClick.AddListener(OnSkillButtonClicked);
EventBus.Unsubscribe<OpenSkillUIEvent>(OnOpenSkillUIEvent);
EventBus.Subscribe<OpenSkillUIEvent>(OnOpenSkillUIEvent);
}
public void OnDestroy()
{
EventBus.Unsubscribe<OpenSkillUIEvent>(OnOpenSkillUIEvent);
}
private void OnOpenSkillUIEvent(OpenSkillUIEvent @event)
{
TryOpenDialog(false);
@@ -35,6 +38,10 @@ namespace BrewMonster
}
public void TryOpenDialog(bool bAction)
{
if(skillUI == null)
{
return;
}
var boolll = skillUI.gameObject.activeInHierarchy;
if (boolll)
{