/// <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);
        }
Beispiel #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);
        }
Beispiel #3
0
 public static void GetRPCMethodInfoFromType(Type type, int rpcMethodIndex, ref RPCMethodInfo rpcMethodInfo)
 {
     rpcMethodInfo = rpcMethods[type][rpcMethodIndex];
 }