From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/XMainClient/UIBuffInfo.cs | 85 +++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UIBuffInfo.cs (limited to 'Client/Assets/Scripts/XMainClient/UIBuffInfo.cs') 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.singleton.GetBuffData((int)this.buffID, (int)this.buffLevel); + bool flag = this.buffInfo == null; + bool result; + if (flag) + { + XSingleton.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; + } + } +} -- cgit v1.1-26-g67d0