本文整理汇总了C#中IPackage.GetCmdID方法的典型用法代码示例。如果您正苦于以下问题:C# IPackage.GetCmdID方法的具体用法?C# IPackage.GetCmdID怎么用?C# IPackage.GetCmdID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPackage
的用法示例。
在下文中一共展示了IPackage.GetCmdID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Receive
/// <summary>
/// Receive the specified package.
/// </summary>
/// <param name="package">Package.</param>
private void Receive(IPackage package)
{
int nCmdID = package.GetCmdID();
#if OPEN_DEBUG_LOG
Debug.Log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Recv net message : " + nCmdID + " Length:" + package.GetLength());
#endif
if (m_dFactory.ContainsKey(nCmdID))
{
DispatchEvent (
new IEvent (EngineEventType.EVENT_NET, nCmdID, m_dFactory[nCmdID].Create(package))
);
}
else
{
#if OPEN_DEBUG_LOG
Debug.LogWarning(">>>> Can't find net message factory : " + nCmdID + " Length:" + package.GetLength());
#endif
}
}
示例2: Receive
/// <summary>
/// Receive the specified package.
/// </summary>
/// <param name="package">Package.</param>
private void Receive(IPackage package)
{
int nCmdID = package.GetCmdID();
#if OPEN_DEBUG_LOG
Debug.Log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Recv net message : " + nCmdID + " Length:" + package.GetLength());
#endif
if (m_dFactory.ContainsKey(nCmdID))
{
IEvent evt = new IEvent (EngineEventType.EVENT_NET, nCmdID, m_dFactory[nCmdID].Create(package));
if (m_dHook.ContainsKey(nCmdID))
{
m_dHook[nCmdID](evt);
}
else
{
DispatchEvent (evt);
}
}
else
{
#if UNITY_EDITOR
Debug.LogError(">>>> Can't find net message factory : " + nCmdID + " Length : " + package.GetLength());
#endif
}
}