少年修仙传客户端代码仓库
hch
2025-03-19 6770e1eb64c4282def45adb824b14b2a407fdd30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
 
using System;
 
namespace vnxbqy.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 = bossSkillTipsConfig.Get(_skillId);
            if (_cfg != null)
            {
                if (_cfg.mode != 3)
                {
                    bossNotifyQueue.Enqueue(_skillId);
                }
                else
                {
                    constDisplaySkill = _skillId;
                }
                if (OnNotifyEvent != null)
                {
                    OnNotifyEvent();
                }
                if (!WindowCenter.Instance.IsOpen<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);
            }
        }
    }
}