- Home /
RPC /Standalone modes
Hi All,
I am building a game which currenlty played by 2 players in the same device. (i.e imagine chess)
Currently I want to enchance my implementation so the game can be played over the net. The easiest way to do that is to re-write all scenes with RPC calls. But I will end up having all my scenes duplicated with RPC (and not) mode.
So is it possible to keep the same set of scripts/code for both RPC and not, and somehow differnentiate at run time?
Answer by Blazor Ramone · Feb 07, 2012 at 07:49 PM
You can check the Network.peerType at runtime to determine if you need to send RPC or call a local function. I am not sure if this is the best solution...
http://unity3d.com/support/documentation/ScriptReference/Network-peerType.html
Answer by gpio · Feb 07, 2012 at 09:38 PM
Hm .........
The problem is how to have the same scene with the same game Object using RPC or standalone methods in ad-hoc mode.....
my suggestion was that hooks could be added in code to behave differently based on connection status. Separate scenes or game objects would not be required. Not entirely sure what you mean by ad-hoc in this context.
Your answer
Follow this Question
Related Questions
Animation Update for the TPS controller 1 Answer
When connected to a server, can other players access my static variables and/or public variables? 2 Answers
destroy player cloned weapon (multiplayer 1 Answer
Photon Networking: RPC call doesn't work over other clients 0 Answers
How to spawn a multiplayer non-player prefab object and sync with all clients? 0 Answers