private RPCTypeDefinition(Type type) { List <ReflectionMethod> delegateMethodsList = new List <ReflectionMethod>(); List <MethodInfo> methods = GetAllMethods(type, typeof(NetworkBehaviour)); for (int i = 0; i < methods.Count; i++) { MethodInfo method = methods[i]; ParameterInfo[] parameters = method.GetParameters(); ReflectionMethod rpcMethod = ReflectionMethod.Create(method, parameters, delegateMethodsList.Count); if (rpcMethod == null) { continue; } Dictionary <ulong, ReflectionMethod> lookupTarget = rpcMethod.serverTarget ? serverMethods : clientMethods; ulong nameHash = HashMethodNameAndValidate(method.Name); if (!lookupTarget.ContainsKey(nameHash)) { lookupTarget.Add(nameHash, rpcMethod); } if (parameters.Length > 0) { ulong signatureHash = HashMethodNameAndValidate(NetworkBehaviour.GetHashableMethodSignature(method)); if (!lookupTarget.ContainsKey(signatureHash)) { lookupTarget.Add(signatureHash, rpcMethod); } } if (rpcMethod.useDelegate) { delegateMethodsList.Add(rpcMethod); } } delegateMethods = delegateMethodsList.ToArray(); }