/// <inheritdoc />
        public virtual void SendRPC(NetDataWriter stream, string rpcName)
        {
            RPCMethodInfo rpcMethodInfo  = null;
            int           rpcMethodIndex = TinyNetStateSyncer.GetRPCMethodInfoFromType(GetType(), rpcName, ref rpcMethodInfo);

            SendRPC(stream, rpcMethodInfo.target, rpcMethodInfo.caller, rpcMethodIndex);
        }
示例#2
0
        public static int GetRPCMethodInfoFromType(Type type, string rpcName, ref RPCMethodInfo rpcMethodInfo)
        {
            for (int i = 0; i < rpcMethods[type].Count; i++)
            {
                if (rpcMethods[type][i].name == rpcName)
                {
                    rpcMethodInfo = rpcMethods[type][i];
                    return(i);
                }
            }

            return(-1);
        }
示例#3
0
 public static void GetRPCMethodInfoFromType(Type type, int rpcMethodIndex, ref RPCMethodInfo rpcMethodInfo)
 {
     rpcMethodInfo = rpcMethods[type][rpcMethodIndex];
 }