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/XSyncDebug.cs | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/XSyncDebug.cs (limited to 'Client/Assets/Scripts/XMainClient/XSyncDebug.cs') diff --git a/Client/Assets/Scripts/XMainClient/XSyncDebug.cs b/Client/Assets/Scripts/XMainClient/XSyncDebug.cs new file mode 100644 index 00000000..15b35ca8 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XSyncDebug.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XSyncDebug + { + private static Dictionary _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.singleton.GetEntity(id); + bool flag = entity != null; + if (flag) + { + bool flag2 = XSyncDebug._map == null; + if (flag2) + { + XSyncDebug._map = new Dictionary(); + } + XFx xfx = null; + bool flag3 = XSyncDebug._map.TryGetValue(id, out xfx); + if (flag3) + { + XSingleton.singleton.DestroyFx(xfx, true); + } + bool flag4 = xfx == null; + if (flag4) + { + XSyncDebug._map.Add(id, null); + } + xfx = XSingleton.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; + } + } + } +} -- cgit v1.1-26-g67d0