private void RpcIncrementScore(NetworkInstanceId netId, int add) { _scores[netId] += add; Debug.Log($"Player with id {netId} won and has {_scores[netId]} points."); OnDictChanged?.Invoke(); OnPlayerWon?.Invoke(netId); }
private void RpcUpdateEntry(NetworkInstanceId netId, int score) { if (_scores.ContainsKey(netId)) { _scores[netId] = score; } else { _scores.Add(netId, score); } Debug.Log($"Synchronized add: {_scores.Keys.Count}"); OnDictChanged?.Invoke(); }
private void RpcRemovePlayer(NetworkInstanceId netId) { _scores.Remove(netId); Debug.Log($"Removed player: {_scores.Keys.Count}"); OnDictChanged?.Invoke(); }
private void RpcAddPlayer(NetworkInstanceId netId) { _scores.Add(netId, 0); Debug.Log($"Added player: {_scores.Keys.Count}"); OnDictChanged?.Invoke(); }