diff --git a/Assets/Scripts/Gameplay/PlayerItem.cs b/Assets/Scripts/Gameplay/PlayerItem.cs index 0cde315..cb3a9dd 100644 --- a/Assets/Scripts/Gameplay/PlayerItem.cs +++ b/Assets/Scripts/Gameplay/PlayerItem.cs @@ -8,6 +8,7 @@ using TMPro; //{ public class PlayerItem : MonoBehaviour { + public ulong PlayerClientID; public TextMeshProUGUI PlayerName; public TextMeshProUGUI PlayerScore; } diff --git a/Assets/Scripts/Gameplay/Scoreboard.cs b/Assets/Scripts/Gameplay/Scoreboard.cs index 1bf6d08..cdbf816 100644 --- a/Assets/Scripts/Gameplay/Scoreboard.cs +++ b/Assets/Scripts/Gameplay/Scoreboard.cs @@ -24,6 +24,7 @@ public class Scoreboard : NetworkBehaviour var item = Instantiate(playerItemPrefab, Parent).GetComponent(); 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; } }