//--------------------------------------------------------
|
// [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;
|
}
|
}
|
|
}
|
|
}
|
|
|
|