using BrewMonster.Scripts.Skills; using BrewMonster.UI; using System; using UnityEngine; using UnityEngine.UI; namespace BrewMonster { public class CDlgSkillAction : AUIDialog { [SerializeField] private Button uiSkillButton; [SerializeField] private GameObject skillUI; bool m_bOpenAction; bool m_bReceivedNCPGreeting; // 是否收到了NPC的Greeting public override void Awake() { base.Awake(); uiSkillButton.onClick.RemoveAllListeners(); uiSkillButton.onClick.AddListener(OnSkillButtonClicked); } private void OnSkillButtonClicked() { TryOpenDialog(false); } public void TryOpenDialog(bool bAction) { var boolll = skillUI.activeInHierarchy; if (boolll) { skillUI.SetActive(!boolll); return; } skillUI.SetActive(!boolll); if (skillUI.activeInHierarchy) if (!GetHostPlayer().IsTalkingWithNPC()) { m_bOpenAction = bAction; CECHostSkillModel.Instance.SendHelloToSkillLearnNPC(); SetReceivedNPCGreeting(false); } } public void SetReceivedNPCGreeting(bool bReceived) { m_bReceivedNCPGreeting = bReceived; } public bool IsReceivedNPCGreeting() { return m_bReceivedNCPGreeting; } } }