For this reason, it is recommended that you understand the fundamental concepts behind networking before you start experimenting with Network Views. They are simple to use, but they are extremely powerful. So this function is sending the viewID that was just allocated by Unity and the position that they want the box spawned at. Network Views are the gateway to creating networked multiplayer games in Unity. The rest of the parameters are the parameters in the function that's going to be called. This means that if the application connects after this function was called, it will call this function because it will be in the buffer and the new application needs to catch up. RPCMode.AllBuffered = This means that it will be called on every connected application and it's buffered. "SpawnBox" = This is the RPC function that is going to be called. Let me tear this function call apart for you so you can better understand it. There is a button displayed on the GUI that says "SpawnBox" and, when clicked, it sends a message to every connected application. PhotonViews ownershipTransfer setting, any client can request to become owner of the PhotonView. NetworkView.RPC("SpawnBox", RPCMode.AllBuffered, viewID, transform.position) PUNs NetworkView replacement class for networking. NetworkViewID viewID = Network.AllocateViewID() I'll explain the example from the link I posted in the comments to help you better understand how these work and how you can manipulate them. You are going to have multiple clients connecting to your server, that's what the NetworkViewID's are for! They'll work perfectly, but you need to know how to set them up properly. NetworkView is a compact network discovery and management tool for the Win32 platform: in a few minutes, it will discover all TCP/IP nodes and draw a full graphical map. With this you can define exactly what is to be synchronized over the network and how it should be done. The issue that you think you're having is not an issue at all. The network view is the binding material of multiplayer games. You can't set the number for this ViewID because Unity needs to make sure that the view is allocated and available. NetworkViewID's are the classes that store the information necessary for for a NetworkView.
0 Comments
Leave a Reply. |