示例#1
0
 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);
 }
示例#2
0
 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();
 }
示例#3
0
 private void RpcRemovePlayer(NetworkInstanceId netId)
 {
     _scores.Remove(netId);
     Debug.Log($"Removed player: {_scores.Keys.Count}");
     OnDictChanged?.Invoke();
 }
示例#4
0
 private void RpcAddPlayer(NetworkInstanceId netId)
 {
     _scores.Add(netId, 0);
     Debug.Log($"Added player: {_scores.Keys.Count}");
     OnDictChanged?.Invoke();
 }