Example #1
0
 public void InvokeOnValueChangeMethods(RPCArgs constructedArgs)
 {
     if (onValueChangeMethods != null)
     {
         foreach (OnValueMethodData methodData in onValueChangeMethods)
         {
             if (net.GetComponent(methodData.componentTypeName) != null)
             {
                 net.GetComponent(methodData.componentTypeName).SendMessage(methodData.methodName, constructedArgs, SendMessageOptions.DontRequireReceiver);
             }
         }
     }
 }
Example #2
0
        public RPCArgs ReturnArgs()
        {
            RPCArgs rpcArgs = new RPCArgs();

            rpcArgs.ownerID = packetOwnerID;

            for (int i = 0; i < parameters.Count; i++)
            {
                if (!ENSUtils.IsSimple(System.Type.GetType(paramTypes[i])))
                {
                    rpcArgs.parameters.Add(JsonUtility.FromJson(parameters[i], System.Type.GetType(paramTypes[i])));
                }
                else
                {
                    System.Type t = System.Type.GetType(paramTypes[i]);
                    rpcArgs.parameters.Add(System.Convert.ChangeType(parameters[i], t));
                }
            }

            return(rpcArgs);
        }
Example #3
0
 public void InvokeRPC(RPCArgs args)
 {
     onRpc.Invoke(args);
     InvokeOnValueChangeMethods(args);
 }