|
|
|
@ -19,7 +19,7 @@ namespace JXSoft {
@@ -19,7 +19,7 @@ namespace JXSoft {
|
|
|
|
|
public Color printColor = Color.white; |
|
|
|
|
|
|
|
|
|
#region ReceiveFunctions |
|
|
|
|
public void sendResponse<T>(string json) where T : IResponse, new() |
|
|
|
|
public void receiveResponse<T>(string json) where T : IResponse, new() |
|
|
|
|
{ |
|
|
|
|
//如果找不到对应命令,则添加命令 |
|
|
|
|
if (mCommandContainer.Get<ExcuteResponseCommand<T>>() == null) |
|
|
|
@ -36,7 +36,7 @@ namespace JXSoft {
@@ -36,7 +36,7 @@ namespace JXSoft {
|
|
|
|
|
/// <typeparam name="T">数据格式类型</typeparam> |
|
|
|
|
public void onReceive<T>() where T : IResponse, new() |
|
|
|
|
{ |
|
|
|
|
onDataRecived.AddListener(sendResponse<T>); |
|
|
|
|
onDataRecived.AddListener(receiveResponse<T>); |
|
|
|
|
} |
|
|
|
|
/// <summary> |
|
|
|
|
/// 关闭接收指定数据 |
|
|
|
@ -44,7 +44,7 @@ namespace JXSoft {
@@ -44,7 +44,7 @@ namespace JXSoft {
|
|
|
|
|
/// <typeparam name="T">数据格式类型</typeparam> |
|
|
|
|
public void offReceive<T>() where T : IResponse, new() |
|
|
|
|
{ |
|
|
|
|
onDataRecived.RemoveListener(sendResponse<T>); |
|
|
|
|
onDataRecived.RemoveListener(receiveResponse<T>); |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|