【发布时间】:2020-01-24 09:19:38
【问题描述】:
我在查看客户端名称时遇到问题,但在我的主控端中显示了播放器的名称,所以我所做的是这样的
public override void OnPlayerEnteredRoom(Player newPlayer)
{
PlayersName();
}
private void PlayersName()
{
if (playerCount == 1)
{
playerNames[0].text = "Kingdom Player 1";
playerNames[1].text = "";
}
else
{
playerNames[0].text = "Kingdom Player 1";
playerNames[1].text = "Kingdom Player 2";
}
}
public override void OnPlayerLeftRoom(Player otherPlayer)
{
PlayersName();
}
现在两边都显示,问题是优化不好。有人可以帮帮我吗?
【问题讨论】:
-
" 是不是优化不好" 你这是什么意思?你能说得更具体点吗?
-
以正确的格式/对齐方式更新帖子,并在内容上做了一些更改。
标签: c# unity3d networking photon