Ejemplo n.º 1
0
 public void PlayerWon()
 {
     //print("PlayerWon");
     DebugManager.LogWithColor("Player Won", Color.green);
     OnPlayerWon?.Invoke();
     _OnPlayerWon?.Invoke();
 }
Ejemplo n.º 2
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);
 }
Ejemplo n.º 3
0
        public static void StepConvertPendingScoresToScores()
        {
            if (HasWinner)
            {
                Debug.LogWarning("Shouldn't convert scores while HasWinner!");
                return;
            }

            foreach (Player player in pendingScoreMap_.Keys.ToArray())
            {
                int pendingScore = GetPendingScore(player);
                if (pendingScore <= 0)
                {
                    continue;
                }

                pendingScoreMap_[player] = pendingScore - 1;
                scoreMap_[player]        = GetScoreFor(player) + 1;
                OnPlayerScoresChanged.Invoke();
            }

            if (HasWinner)
            {
                OnPlayerWon.Invoke();
            }
        }
Ejemplo n.º 4
0
 public void PlayerWon()
 {
     OnPlayerWon?.Invoke();
 }