From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/UI/ArtifactQuanlityFx.cs | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/ArtifactQuanlityFx.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/ArtifactQuanlityFx.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/ArtifactQuanlityFx.cs b/Client/Assets/Scripts/XMainClient/UI/ArtifactQuanlityFx.cs new file mode 100644 index 00000000..4ec5fd38 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/ArtifactQuanlityFx.cs @@ -0,0 +1,40 @@ +using System; +using UnityEngine; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class ArtifactQuanlityFx + { + private bool m_isUsing = false; + + private ulong m_key = 0UL; + + private XFx m_fx = null; + + public void SetData(ulong key, Transform tra, string path) + { + this.Reset(); + this.m_isUsing = true; + this.m_key = key; + this.m_fx = XSingleton.singleton.CreateUIFx(path, tra, false); + } + + public void Reset() + { + this.m_key = 0UL; + this.m_isUsing = false; + bool flag = this.m_fx != null; + if (flag) + { + XSingleton.singleton.DestroyFx(this.m_fx, true); + this.m_fx = null; + } + } + + public bool IsCanReuse(ulong key) + { + return this.m_isUsing && this.m_key == key; + } + } +} -- cgit v1.1-26-g67d0