少年修仙传客户端代码仓库
hch
2023-10-24 34af05a856564e02eb8d5191ea7ad367213bf6e0
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Thursday, November 16, 2017
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
using System;
 
namespace Snxxz.UI
{
 
    
    public class MainRedDot : Singleton<MainRedDot>
    {
        public const int RedPoint_key = 1;
        public const int FAIRY_REDPOINT_KEY1 = 107;
        public const int RedPoint_key1 = 106;
        public const int RedPoint_UpFuncBase = 2;
        public const int RedPoint_VipDot = 35;//VIP界面
 
        private Redpoint rightTopRedpint = new Redpoint(RedPoint_UpFuncBase);
 
        private Redpoint redPointStrePrentOne = new Redpoint(RedPoint_key);
        private Redpoint redPointStrePrent = new Redpoint(RedPoint_key, RedPoint_key1);
        private Redpoint welfareRedPoint = new Redpoint(201);
        private Redpoint realmRedpoint = new Redpoint(114);
        private Redpoint redPointVipDot = new Redpoint(RedPoint_VipDot);
 
        #region 角色红点
        public Redpoint roleRedpoint = new Redpoint(RedPoint_key, 101);
        public Redpoint roleTagRedpoint = new Redpoint(101, 10101);
        #endregion
 
        //public Redpoint jadeDynastyRedpoint = new Redpoint(1, 117);
 
        #region 邮件红点
        public const int RedPoint_MainMailKey = 24;
        public const int RedPoint_MailFuncKey = 2401;
        public Redpoint redpointMainMail = new Redpoint(RedPoint_MainMailKey);
        public Redpoint redpointMailFunc = new Redpoint(RedPoint_MainMailKey, RedPoint_MailFuncKey);
        #endregion
 
        #region 好友红点
        public const int RedPoint_FriendQuestKey = 26;
        public const int RedPoint_FriendChatKey = 25; //好友
        public Redpoint redpointFriendQuest = new Redpoint(RedPoint_FriendQuestKey);
        public Redpoint redPointFriendChat = new Redpoint(RedPoint_FriendChatKey);
        #endregion
 
        #region 背包红点
        public const int RedPoint_MainPackKey = 102;
        public const int RedPoint_BagFuncKey = 10201;
        public const int RedPoint_DepotFuncKey = 10204;
        public Redpoint redPointMainPack = new Redpoint(RedPoint_MainPackKey);
        public Redpoint redPointBagFunc = new Redpoint(RedPoint_MainPackKey, RedPoint_BagFuncKey);
        public Redpoint redPointDepotFunc = new Redpoint(RedPoint_MainPackKey, RedPoint_DepotFuncKey);
        #endregion
 
        #region 洗炼红点
        public const int RedPoint_WashFuncKey = 10605;
        public Redpoint redPointWashFunc = new Redpoint(RedPoint_key1, RedPoint_WashFuncKey);
        #endregion
 
        #region 套装红点
        public const int RedPoint_SuitFuncKey = 10604;
        public Redpoint redPointSuitFunc = new Redpoint(RedPoint_key1, RedPoint_SuitFuncKey);
        #endregion
 
        #region 仙盟公用红点
        public const int FAIRY_REDPOINT_KEY2 = 10701;
        public Redpoint fairyLaunch = new Redpoint(RedPoint_key, FAIRY_REDPOINT_KEY1);
        public Redpoint fairyBaseFuncRedPoint = new Redpoint(FAIRY_REDPOINT_KEY1, FAIRY_REDPOINT_KEY2);
        #endregion
 
        #region 仙盟活跃红点
        public const int FAIRYLiven_REDPOINT_KEY3 = 1070107;
        public Redpoint fairyLivenRedPoint = new Redpoint(FAIRY_REDPOINT_KEY2, FAIRYLiven_REDPOINT_KEY3);
        #endregion
 
        #region 仙盟商店红点
        public const int FAIRYStore_REDPOINT_KEY3 = 1070106;
        public Redpoint fairyStoreRedPoint = new Redpoint(FAIRY_REDPOINT_KEY2, FAIRYStore_REDPOINT_KEY3);
        #endregion
 
 
        #region 坐骑红点/灵宠红点
 
        public const int RedPoint_PetKey = 105;
        public Redpoint redPointPetKeyFunc = new Redpoint(RedPoint_key, RedPoint_PetKey);
        public const int RedPoint_MountPackKey = 10501;
        public Redpoint redPointMountFunc = new Redpoint(RedPoint_PetKey, RedPoint_MountPackKey);
        public const int RedPoint_PetKey2 = 10502;
        public Redpoint redPonintPetFunc2 = new Redpoint(RedPoint_PetKey, RedPoint_PetKey2);
        #endregion
 
        #region 开服活动红点
        public const int REDPOINT_OPENSERVER = 209;
        public Redpoint openServerRedpoint = new Redpoint(REDPOINT_OPENSERVER);
 
        //280 开头用于节日祝福
        public const int RedPoint_HolidayWishes = 280;
        public Redpoint holidayWishesRedpoint = new Redpoint(RedPoint_HolidayWishes);
 
        #endregion
        public const int REDPOINT_OPENRANK = 258;
        public Redpoint openRankRedpoint = new Redpoint(REDPOINT_OPENRANK);
        #region 仙盟活动红点
        public readonly Redpoint fairyActivityRedpoint = new Redpoint(218);
        #endregion
 
        // boss首杀
        public const int REDPOINT_BOSSFIRSTKILL = 600;
 
        public void Register()
        {
            RedpointCenter.Instance.redpointValueChangeEvent -= OnRedpointChange;
            RedpointCenter.Instance.redpointValueChangeEvent += OnRedpointChange;
        }
 
        public List<int> rightTopHideRedpoints = new List<int>()
        {
            210,
            212,
            214,
            216,
            280,
            401,
            402,
            403,
            406,
            413,
            421,
            433,
            500,
        };
 
        private void OnRedpointChange(int id)
        {
            if (rightTopHideRedpoints.Contains(id))
            {
                var redpiontState = RedPointState.None;
                for (int i = 0; i < rightTopHideRedpoints.Count; i++)
                {
                    var redpointId = rightTopHideRedpoints[i];
                    if (RedpointCenter.Instance.GetRedpointState(redpointId) != RedPointState.None)
                    {
                        redpiontState = RedPointState.Simple;
                        break;
                    }
                }
 
                rightTopRedpint.state = redpiontState;
            }
        }
 
    }
 
}