using System.Collections; using System.Collections.Generic; using UnityEngine; using System; namespace vnxbqy.UI { public static class BossNotify { private static Queue bossNotifyQueue = new Queue(); public static int constDisplaySkill = 0; public static event Action releaseNotifyEvent; public static event Action OnNotifyEvent; public static event Action OnNotifyStateEvent; public static void Notify(int _skillId) { var _cfg = bossSkillTipsConfig.Get(_skillId); if (_cfg != null) { if (_cfg.mode != 3) { bossNotifyQueue.Enqueue(_skillId); } else { constDisplaySkill = _skillId; } if (OnNotifyEvent != null) { OnNotifyEvent(); } if (!WindowCenter.Instance.IsOpen()) { WindowCenter.Instance.Open(); } } } public static int Request() { if (bossNotifyQueue.Count > 0) { return bossNotifyQueue.Dequeue(); } return 0; } public static void Release(int _skillId) { if (releaseNotifyEvent != null) { releaseNotifyEvent(_skillId); if (constDisplaySkill == _skillId) { constDisplaySkill = 0; } } } public static void SetNotifyComplete(int _skillId) { if (OnNotifyStateEvent != null) { OnNotifyStateEvent(_skillId, false); } } public static void SetNofityStart(int _skillId) { if (OnNotifyStateEvent != null) { OnNotifyStateEvent(_skillId, true); } } } }