diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/UIBuffInfo.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UIBuffInfo.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/UIBuffInfo.cs | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/UIBuffInfo.cs b/Client/Assets/Scripts/XMainClient/UIBuffInfo.cs new file mode 100644 index 00000000..50ade5e0 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UIBuffInfo.cs @@ -0,0 +1,85 @@ +using System;
+using UnityEngine;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class UIBuffInfo
+ {
+ public uint buffID;
+
+ public uint buffLevel;
+
+ public float leftTime;
+
+ public float startTime;
+
+ public double HP;
+
+ public double maxHP;
+
+ public ulong mobUID;
+
+ public bool bReduceCD;
+
+ public int transformID;
+
+ public uint stackCount;
+
+ public BuffTable.RowData buffInfo;
+
+ public static UIBuffInfo Create(XBuff buff)
+ {
+ UIBuffInfo uibuffInfo = new UIBuffInfo();
+ uibuffInfo.Set(buff);
+ return uibuffInfo;
+ }
+
+ public void Set(XBuff buff)
+ {
+ this.buffID = (uint)buff.ID;
+ this.buffLevel = (uint)buff.Level;
+ this.leftTime = buff.GetLeftTime();
+ this.startTime = Time.time;
+ this.HP = buff.HP;
+ this.maxHP = buff.MaxHP;
+ this.mobUID = buff.EffectData.MobID;
+ this.stackCount = buff.StackCount;
+ this.buffInfo = buff.BuffInfo;
+ }
+
+ public static UIBuffInfo Create(ServerBuffInfo buff)
+ {
+ UIBuffInfo uibuffInfo = new UIBuffInfo();
+ uibuffInfo.Set(buff);
+ return uibuffInfo;
+ }
+
+ public bool Set(ServerBuffInfo buff)
+ {
+ this.buffID = buff.buffID;
+ this.buffLevel = buff.buffLevel;
+ this.leftTime = buff.leftTime;
+ this.startTime = Time.realtimeSinceStartup;
+ this.HP = buff.HP;
+ this.maxHP = buff.maxHP;
+ this.mobUID = buff.mobUID;
+ this.bReduceCD = buff.bReduceCD;
+ this.transformID = buff.transformID;
+ this.stackCount = buff.stackCount;
+ this.buffInfo = XSingleton<XBuffTemplateManager>.singleton.GetBuffData((int)this.buffID, (int)this.buffLevel);
+ bool flag = this.buffInfo == null;
+ bool result;
+ if (flag)
+ {
+ XSingleton<XDebug>.singleton.AddErrorLog(string.Format("Set Server Buff data not found: [{0} {1}]", this.buffID, this.buffLevel), null, null, null, null, null);
+ result = false;
+ }
+ else
+ {
+ result = true;
+ }
+ return result;
+ }
+ }
+}
|