Differences between PUN and Unity Networking
PUN provides a consistent, familiar API to those who have already worked with Unity Networking. However, there are many key differences and some code is not compatible without changes.
In PUN, nearly all of the main functions are contained in the PhotonNetwork
class (meant to be analogous to the Network
class in Unity). There is no MasterServer equivalent in PUN: all the required functions are moved to the PhotonNetwork
class.
Rather than initializing servers, in PUN you create "rooms" via PhotonNetwork.CreateRoom
. Rooms are essentially partitions on the game server to separate groups of players from each other.
There is no longer a concept of host IP. Instead, to connect to a room, you pass either Room
to the JoinRoom
function, or you pass the name of the room (room names are required to be unique).
Note
Because of the way Photon Unity Networking works, direct LAN connection is not possible as rather than connecting to each other, players...