I am creating a simple LAN based(no internet required) multiplayer game with only 3 players at max two being clients and one being server.I have created two scripts for client and server respectively, how can I send data back and forth using NetworkViews and RPCs.
For example, the following code invokes an RPC function with a single string parameter:
networkView.RPC ("PrintText", RPCMode.All, "Hello world");
the PrintText function shown above will be can be declared as:
`
[RPC]
function PrintText (text : String, info : NetworkMessageInfo){
Debug.Log(text + " from " + info.sender);
}
`
The Network Manual