mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
doc: Fixed ReplacePlayer example
This commit is contained in:
parent
d0e15b1378
commit
2fc68d3e91
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user