summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/XSyncDebug.cs
blob: 15b35ca83a74f01aa15722d6fb0b545ca5def373 (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
41
42
43
44
45
46
47
48
49
50
using System;
using System.Collections.Generic;
using UnityEngine;
using XUtliPoolLib;

namespace XMainClient
{
	internal class XSyncDebug
	{
		private static Dictionary<ulong, XFx> _map = null;

		public static void OnLeaveScene()
		{
			bool flag = XSyncDebug._map != null;
			if (flag)
			{
				XSyncDebug._map.Clear();
			}
		}

		public static void DrawDebug(ulong id, Vector3 pos, Quaternion face)
		{
			XEntity entity = XSingleton<XEntityMgr>.singleton.GetEntity(id);
			bool flag = entity != null;
			if (flag)
			{
				bool flag2 = XSyncDebug._map == null;
				if (flag2)
				{
					XSyncDebug._map = new Dictionary<ulong, XFx>();
				}
				XFx xfx = null;
				bool flag3 = XSyncDebug._map.TryGetValue(id, out xfx);
				if (flag3)
				{
					XSingleton<XFxMgr>.singleton.DestroyFx(xfx, true);
				}
				bool flag4 = xfx == null;
				if (flag4)
				{
					XSyncDebug._map.Add(id, null);
				}
				xfx = XSingleton<XFxMgr>.singleton.CreateFx("Effects/FX_Particle/Roles/Lzg_Ty/sync_debug_fx", null, false);
				pos.y += entity.Height * 0.5f;
				xfx.Play(pos, face, entity.Radius * 2f * Vector3.one, 1f);
				XSyncDebug._map[id] = xfx;
			}
		}
	}
}