Search Unity

Question about Networking example! [RPC] function LoadLevel

Discussion in 'Multiplayer' started by northman, Oct 27, 2009.

  1. northman

    northman

    Joined:
    Feb 28, 2008
    Posts:
    144
    :(

    hello, friends:

    I learn the example project [Networking], I read the codes but I don't understood about the function [LoadLevel], about these:

    ConnectGuiMasterServer.js
    NetworkLevelLoad.js

    when I run the networking in other PC, make a server, and I run another networking in my mac, I can see the server that other PC created.

    I click the 'connect' button to connect to server. then the @RPC function 'LoadLevel' was called.

    But I couldn't find out which function call the 'LoadLevel', why the 'LoadLevel' can be called?

    Any friend can teach me?

    Sincerely yours
    Shawn Zhang
    :?:
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    The LoadLevel function is actually called on line 33 of NetworkLevelLoad.js. What is slightly unusual is that it is called via the NetworkView.RPC function - the doc page has information about how this function is used.