|
|
|
@ -24,6 +24,7 @@ public class Scoreboard : NetworkBehaviour
|
|
|
|
|
var item = Instantiate(playerItemPrefab, Parent).GetComponent<PlayerItem>();
|
|
|
|
|
item.PlayerName.text = name;
|
|
|
|
|
item.PlayerScore.text = score.ToString();
|
|
|
|
|
item.PlayerClientID = clientId;
|
|
|
|
|
playerItems.Add(item);
|
|
|
|
|
}
|
|
|
|
|
public void ScoreBoardUpdater(string playerName, int score)
|
|
|
|
@ -38,6 +39,8 @@ public class Scoreboard : NetworkBehaviour
|
|
|
|
|
if (item.PlayerName.text == playerName)
|
|
|
|
|
{
|
|
|
|
|
item.PlayerScore.text = score.ToString();
|
|
|
|
|
if (NetworkManager.Singleton.LocalClientId == item.PlayerClientID)
|
|
|
|
|
item.PlayerScore.color = Color.green;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|