summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/ArtifactQuanlityFx.cs
blob: 4ec5fd381e30742744cd1463626e88234cf3a39f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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<XFxMgr>.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<XFxMgr>.singleton.DestroyFx(this.m_fx, true);
				this.m_fx = null;
			}
		}

		public bool IsCanReuse(ulong key)
		{
			return this.m_isUsing && this.m_key == key;
		}
	}
}