doc: Fixed ReplacePlayer example

This commit is contained in:
Chris Langsenkamp 2020-05-02 21:54:22 -04:00
parent d0e15b1378
commit 2fc68d3e91

View File

@ -101,10 +101,8 @@ You can also use `ReplacePlayerForConnection` to respawn a player or change the
``` cs ``` cs
public class MyNetworkManager : NetworkManager public class MyNetworkManager : NetworkManager
{ {
public void ReplacePlayer(GameObject newPrefab) public void ReplacePlayer(NetworkConnection conn, GameObject newPrefab)
{ {
NetworkConnection conn = NetworkClient.connection;
// Cache a reference to the current player object // Cache a reference to the current player object
GameObject oldPlayer = conn.identity.gameObject; GameObject oldPlayer = conn.identity.gameObject;