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/XUtliPoolLib/XCallCommand.cs | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Client/Assets/Scripts/XUtliPoolLib/XCallCommand.cs (limited to 'Client/Assets/Scripts/XUtliPoolLib/XCallCommand.cs') diff --git a/Client/Assets/Scripts/XUtliPoolLib/XCallCommand.cs b/Client/Assets/Scripts/XUtliPoolLib/XCallCommand.cs new file mode 100644 index 00000000..9feea104 --- /dev/null +++ b/Client/Assets/Scripts/XUtliPoolLib/XCallCommand.cs @@ -0,0 +1,36 @@ +using System; + +namespace XUtliPoolLib +{ + public class XCallCommand + { + public static ExecuteCommandHandler handler = new ExecuteCommandHandler(XCallCommand.Execute); + + public static DebugHandler debugHandler = new DebugHandler(XCallCommand.DebugString); + + public static void DebugString(XGameObject gameObject, XEngineCommand command, string str, int id) + { + bool flag = command.data != null; + if (flag) + { + XSingleton.singleton.AddWarningLog2("[EngineCommand] CallCmd {0} ID:{1} data:{2} location:{3} objID:{4}", new object[] + { + str, + id, + command.data.data, + gameObject.m_Location, + gameObject.objID + }); + } + } + + public static void Execute(XGameObject gameObject, XEngineCommand command) + { + bool flag = command.data != null && command.data.commandCb != null; + if (flag) + { + command.data.commandCb(gameObject, command.data.data, command.commandID); + } + } + } +} -- cgit v1.1-26-g67d0