少年修仙传客户端代码仓库
client_linchunjie
2018-08-27 d106f11e7f44c748f595da36e0cdfd54849649e6
System/Message/BossNotify.cs
@@ -1,81 +1,81 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TableConfig;
using System;
namespace Snxxz.UI
{
    public static class BossNotify
    {
        private static Queue<int> bossNotifyQueue = new Queue<int>();
        public static int constDisplaySkill = 0;
        public static event Action<int> releaseNotifyEvent;
        public static event Action OnNotifyEvent;
        public static event Action<int, bool> OnNotifyStateEvent;
        public static void Notify(int _skillId)
        {
            var _cfg = ConfigManager.Instance.GetTemplate<bossSkillTipsConfig>(_skillId);
            if (_cfg != null)
            {
                if (_cfg.mode != 3)
                {
                    bossNotifyQueue.Enqueue(_skillId);
                }
                else
                {
                    constDisplaySkill = _skillId;
                }
                if (OnNotifyEvent != null)
                {
                    OnNotifyEvent();
                }
                if (!WindowCenter.Instance.CheckOpen<BossNotifyWin>())
                {
                    WindowCenter.Instance.Open<BossNotifyWin>();
                }
            }
        }
        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);
            }
        }
    }
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TableConfig;
using System;
namespace Snxxz.UI
{
    public static class BossNotify
    {
        private static Queue<int> bossNotifyQueue = new Queue<int>();
        public static int constDisplaySkill = 0;
        public static event Action<int> releaseNotifyEvent;
        public static event Action OnNotifyEvent;
        public static event Action<int, bool> OnNotifyStateEvent;
        public static void Notify(int _skillId)
        {
            var _cfg = Config.Instance.Get<bossSkillTipsConfig>(_skillId);
            if (_cfg != null)
            {
                if (_cfg.mode != 3)
                {
                    bossNotifyQueue.Enqueue(_skillId);
                }
                else
                {
                    constDisplaySkill = _skillId;
                }
                if (OnNotifyEvent != null)
                {
                    OnNotifyEvent();
                }
                if (!WindowCenter.Instance.CheckOpen<BossNotifyWin>())
                {
                    WindowCenter.Instance.Open<BossNotifyWin>();
                }
            }
        }
        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);
            }
        }
    }
}