This part of the guide shows you how to access other players on the network, including the local player. The string "Network joined!" displays in the Console window. Save and select Play in the Unity Editor. Please refer to the sample in this Unity plugin for an example of how to do that. There are many ways to get the Network ID from the host to other players who want to join. private void OnNetworkJoined(object sender, string networkId) To define the OnNetworkJoined event handler, add the following code to the class. ![]() To define an event that fires when your local client joins the network, add the following code to the OnLoginSuccess method: PlayFabMultiplayerManager.Get().OnNetworkJoined += OnNetworkJoined ![]() PlayFabMultiplayerManager.Get().JoinNetwork(networkId) In the OnLoginSuccess method, add the following code to Join a network: string networkId = "" This part of the guide shows you how to join an existing network that another client created. The Network ID displays in the Console window. Print the Network ID so you can give it to the other client. To define the OnNetworkJoined event handler, add the following code to the class: private void OnNetworkJoined(object sender, string networkId) PlayFabMultiplayerManager.Get().OnNetworkJoined += OnNetworkJoined ![]() In the OnLoginSuccess method, add the following code to create and join a network: PlayFabMultiplayerManager.Get().CreateAndJoinNetwork() This part of the guide shows you how to Create and Join a network.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |