NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/UI/Mail/SingleMail.cs

62 lines
1.6 KiB
C#
Raw Normal View History

2023-12-11 18:56:57 +08:00
using cfg;
using cfg.ActorCfg;
using Framework;
using Gameplay.Net;
using NLDPB;
namespace Gameplay
{
public class SingleMail:Mail
{
2023-12-12 19:35:47 +08:00
string NPOI;
2023-12-18 19:59:06 +08:00
DataMail mCfg;
private RedPointNode _redPointNode;
2023-12-12 19:35:47 +08:00
2023-12-18 19:59:06 +08:00
public RedPointNode RedPointNode => _redPointNode;
public DataMail Cfg => mCfg;
2023-12-11 18:56:57 +08:00
public SingleMail(Mail mail)
{
Refresh(mail);
2023-12-18 19:59:06 +08:00
ConstructRedPointTree();
}
public void ConstructRedPointTree()
{
_redPointNode = RedPointManager.Instance.AddDynamicNode(cfg.RedPoint.NodeType.Normal, 20,mCfg.Id);
2023-12-11 18:56:57 +08:00
}
public void Refresh(Mail mail)
{
2023-12-18 19:59:06 +08:00
mCfg = TableManager.Instance.Tables.MailCfg.GetOrDefault((int)mail.MailID);
if(mCfg == null)
2023-12-12 19:35:47 +08:00
{
DebugUtil.LogError("邮件配置没有id为", mail.MailID);
2023-12-18 19:59:06 +08:00
mCfg = TableManager.Instance.Tables.MailCfg.DataList[0];
2023-12-12 19:35:47 +08:00
}
2023-12-11 18:56:57 +08:00
SendTime = mail.SendTime;
Status = mail.Status;
MailID = mail.MailID;
2023-12-12 19:35:47 +08:00
Id = mail.Id;
2023-12-11 18:56:57 +08:00
Title = mail.Title;
Body = mail.Body;
2023-12-12 19:35:47 +08:00
2023-12-11 18:56:57 +08:00
if (mail.MailData != null)
{
MailData = mail.MailData;
}
}
public void SetStatus(uint stu)
{
2023-12-19 14:19:07 +08:00
EventManager.Instance.Send(EventManager.EventName.MailStateChange);
if (Status==MailSystem.MailStatus_Cliamed)
2023-12-13 16:51:07 +08:00
{
return;
}
2023-12-19 14:19:07 +08:00
2023-12-11 18:56:57 +08:00
Status = stu;
}
}
}