summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/XSyncDebug.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-25 14:28:30 +0800
committerchai <chaifix@163.com>2021-01-25 14:28:30 +0800
commit6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch)
tree7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/XSyncDebug.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/XSyncDebug.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/XSyncDebug.cs50
1 files changed, 50 insertions, 0 deletions
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<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;
+ }
+ }
+ }
+}