Hello everyone!
Remote Variable Call(RVC) is now available on the Unity Asset Store
I created Remote Variable Call while networking my own game because I was unsatisfied with the capacity of the default RPC method.
RVC expands on RPC in two ways:
- It allows you to directly sync a variable over the network with a single line of code – no need for a recipient [RPC] tagged method.
- It supports a wide variety of data types, including Array, Color, Color32, Vector2, Vector4, DateTime, and any custom class tagged with the [System.Serializable] attribute.
How to use:
- Attach a NetworkView to your GameObject .
- Add the [RVC] attribute infront of any variable you wish to send.
- Call networkView.RVC(RPCMode/NetworkPlayer, variables) with the appropriate syntax(see example image) from within any script attached to the GameObject.
The included variables will then be automatically synced over the Network. No other methods/functions are required!
Included Methods:
networkView.RVC() - Syncs any number of specific variables over the network
networkView.RVCAll() - Sync all variables tagged with the [RVC] attribute within the calling script
networkView.RMC() - Identical to RPC(), but allows for a larger number of data types to be sent.
Example:
Demonstration Video
I hope you enjoy it!
Please e-mail me with any question, concerns, or comments.
Adam Kauper
akauper@gmail.com