x


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?

more ▼

asked Feb 07 '12 at 03:08 PM

gpio gravatar image

gpio
16 2 4 6

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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

more ▼

answered Feb 07 '12 at 07:49 PM

Blazor Ramone gravatar image

Blazor Ramone
134 1 2 5

(comments are locked)
10|3000 characters needed characters left

Hm .........

The problem is how to have the same scene with the same game Object using RPC or standalone methods in ad-hoc mode.....

more ▼

answered Feb 07 '12 at 09:38 PM

gpio gravatar image

gpio
16 2 4 6

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.

Feb 09 '12 at 01:47 AM Blazor Ramone
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x681
x237
x17

asked: Feb 07 '12 at 03:08 PM

Seen: 368 times

Last Updated: Feb 09 '12 at 01:47 AM