UNET parameter restrictions for Command and ClientRpc methods?

Are Command and ClientRpc methods restricted to have certain types of parameters?

I was interested in sending a data object over RPC to the clients and initially tried to send it via RPC but the client receives the message with a null argument, I expected that this would be the case but tried it just for good measure.

However then I attempted to locate information regarding what a Command or ClientRpc could have as its parameters and I found no information.

Is it limited to primatives? Can I send enums? Can there be multiple parameters?

If I wanted to send a complex object then I guess that I have to construct my own serialized message and send this to the clients, is this correct?

Command and ClientRPC are limited to the same types as those which SyncVar supports. From the manual

SyncVars can be basic types such as integers, strings and floats. They can also be Unity types such as Vector3 and user-defined structs, but updates for struct SyncVars are sent as monolithic updates, not incremental changes if fields within a struct change.

As for sending references to a GameObject, send it’s NetworkInstanceId (assuming it’s a NetworkBehaviour) and call ClientScene.FindLocalObject( NetworkInstanceId ) on it. You can also use NetworkServer.FindLocalObject for server-side lookup.

Sending more complex data would mean custom serialization, but NetworkWriter and NetworkReader are pretty nice to use. If you’re looking for some examples of how to use it, look inside NetworkTransform.