aha
This commit is contained in:
18
Assets/Mirror/Examples/Chat/Scripts/Player.cs
Normal file
18
Assets/Mirror/Examples/Chat/Scripts/Player.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace Mirror.Examples.Chat
|
||||
{
|
||||
public class Player : NetworkBehaviour
|
||||
{
|
||||
[SyncVar]
|
||||
public string playerName;
|
||||
|
||||
public override void OnStartServer()
|
||||
{
|
||||
playerName = (string)connectionToClient.authenticationData;
|
||||
}
|
||||
|
||||
public override void OnStartLocalPlayer()
|
||||
{
|
||||
ChatUI.localPlayerName = playerName;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user