mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Updated SpawnPlayerCustom.md
This commit is contained in:
parent
0b7d326007
commit
a00a46cc83
@ -26,11 +26,11 @@ using Mirror;
|
||||
|
||||
public class MyNetworkManager : NetworkManager
|
||||
{
|
||||
public override void OnServerAddPlayer(NetworkConnection conn)
|
||||
public override void OnServerAddPlayer(NetworkConnection conn, AddPlayerMessage extraMessage)
|
||||
{
|
||||
GameObject player = (GameObject)Instantiate(playerPrefab, Vector3.zero, Quaternion.identity);
|
||||
player.GetComponent<Player>().color = Color.red;
|
||||
NetworkServer.AddPlayerForConnection(conn, player, conn.playerControllerId);
|
||||
NetworkServer.AddPlayerForConnection(conn, player);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user