The player object must be created on all clients and the server, and this is the simplest way of accomplishing that.Īlso, notice that the server AND the client is maintaining the HashTable of all players. Notice that we are using RPCMode.All - which will send the JoinPlayer() RPC to all players and the server. In OnPlayerConnected(), we execute this RPC call to all connected clients using the server's world networkView. OK, let's look at the important parts, starting with our first RPC in OnPlayerConnected() networkView.RPC("JoinPlayer", RPCMode.All, newViewID, Vector3.zero, p) If you haven't done so already, grab the Unity package and open up the networkController script so you can follow along. I should probably mention that before we get too far into things and PFDs start flying all over the place. Did I mention that I <3 process flow diagrams. To help explain how this is accomplished, let's take a look at a process flow diagram.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |