This commit is contained in:
CortexCore
2024-06-12 16:49:42 +08:00
parent 126131b842
commit dab0eec438
7 changed files with 143 additions and 47 deletions

View File

@@ -15,6 +15,11 @@ using UnityEngine;
namespace BITKit
{
[AttributeUsage(AttributeTargets.Method)]
public sealed class NetRpcAttribute : Attribute
{
}
/// <summary>
/// 网络指令类型
/// </summary>
@@ -74,7 +79,7 @@ namespace BITKit
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
UniTask<T> GetFromServer<T>(string path = null,T command = default);
UniTask<T> GetFromServer<T>(string path = null,params object[] pars);
/// <summary>
/// 从客户端获取数据
@@ -83,7 +88,7 @@ namespace BITKit
/// <param name="addressablePath">可寻址路劲 e.g. Key</param>
/// <typeparam name="T">远程指令类型</typeparam>
/// <returns></returns>
UniTask<T> GetFromClient<T>(int id,string path = null,T command = default);
UniTask<T> GetFromClient<T>(int id,string path = null,params object[] pars);
/// <summary>
/// 添加RPC远程服务服务类型为需要的方法标记[RPC]