|
|
@ -25,22 +25,26 @@ public class ScoreManager : NetworkBehaviour
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (IsServer)
|
|
|
|
if (IsServer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
//foreach (var clientId in NetworkManager.Singleton.ConnectedClientsIds)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// //InitializePlayerScoreServerRpc(clientId, $"Player_{clientId}");
|
|
|
|
|
|
|
|
// InitializePlayerScoreServerRpc(clientId, player");
|
|
|
|
|
|
|
|
//}
|
|
|
|
StartCrowPenaltyCoroutineServerRpc();
|
|
|
|
StartCrowPenaltyCoroutineServerRpc();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[ServerRpc(RequireOwnership = false)]
|
|
|
|
[ServerRpc(RequireOwnership = false)]
|
|
|
|
public void InitializePlayerScoreServerRpc(ulong ownerClientId,string name)
|
|
|
|
public void InitializePlayerScoreServerRpc(ulong ownerClientId, string name)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!playerScores.ContainsKey(ownerClientId))
|
|
|
|
if (!playerScores.ContainsKey(ownerClientId))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
playerScores[ownerClientId] = 200;
|
|
|
|
playerScores[ownerClientId] = 200;
|
|
|
|
Debug.Log($"[ScoreManager] Player {ownerClientId} initialized with a starting score of 200.");
|
|
|
|
playerNames[ownerClientId] = name;
|
|
|
|
UpdatePlayerScoreClientRpc(ownerClientId, 200);
|
|
|
|
|
|
|
|
playerNames[ownerClientId]= name;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Scoreboard.instance.ScoreBoardItemInitializer(ownerClientId, playerScores[ownerClientId],name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Debug.Log($"[ScoreManager] Player {ownerClientId} initialized with a starting score of 200 and name '{name}'.");
|
|
|
|
|
|
|
|
Scoreboard.instance.ScoreBoardItemInitializer(ownerClientId, playerScores[ownerClientId], name);
|
|
|
|
|
|
|
|
UpdatePlayerScoreClientRpc(ownerClientId, 200);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -48,13 +52,11 @@ public class ScoreManager : NetworkBehaviour
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void UpdatePlayerScore(ulong ownerClientId, int newScore)
|
|
|
|
public void UpdatePlayerScore(ulong ownerClientId, int newScore)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (playerScores.ContainsKey(ownerClientId))
|
|
|
|
if (playerScores.ContainsKey(ownerClientId))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
playerScores[ownerClientId] = newScore;
|
|
|
|
playerScores[ownerClientId] = newScore;
|
|
|
|
Scoreboard.instance.ScoreBoardUpdater(ownerClientId, newScore);
|
|
|
|
|
|
|
|
Debug.Log($"[ScoreManager] Updating Player {ownerClientId} score to {newScore}.");
|
|
|
|
Debug.Log($"[ScoreManager] Updating Player {ownerClientId} score to {newScore}.");
|
|
|
|
UpdatePlayerScoreClientRpc(ownerClientId, newScore);
|
|
|
|
UpdatePlayerScoreClientRpc(ownerClientId, newScore);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -64,44 +66,37 @@ public class ScoreManager : NetworkBehaviour
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AddPlayerScore(ulong ownerClientId, int newScore)
|
|
|
|
[ClientRpc]
|
|
|
|
|
|
|
|
public void UpdatePlayerScoreClientRpc(ulong ownerClientId, int newScore)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (playerScores.ContainsKey(ownerClientId))
|
|
|
|
if (playerNames.ContainsKey(ownerClientId))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
playerScores[ownerClientId] += newScore;
|
|
|
|
string playerName = playerNames[ownerClientId];
|
|
|
|
Debug.Log($"[ScoreManager] Updating Player {ownerClientId} score to {playerScores[ownerClientId]}.");
|
|
|
|
Debug.Log($"[ScoreManager] Received score update for Player {ownerClientId} (Name: {playerName}): {newScore}");
|
|
|
|
UpdatePlayerScoreClientRpc(ownerClientId, playerScores[ownerClientId]);
|
|
|
|
Scoreboard.instance.ScoreBoardUpdater(playerName, newScore);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Debug.LogError($"[ScoreManager] No entry found for Player {ownerClientId}. Cannot update score.");
|
|
|
|
Debug.LogError($"[ScoreManager] Player name not found for Player {ownerClientId}. Cannot update scoreboard.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SubtractPlayerScore(ulong ownerClientId, int scoreToSubtract)
|
|
|
|
public void AddPlayerScore(ulong ownerClientId, int scoreToAdd)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (playerScores.ContainsKey(ownerClientId))
|
|
|
|
if (playerScores.ContainsKey(ownerClientId))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int value = Mathf.Max(0, playerScores[ownerClientId] - scoreToSubtract);
|
|
|
|
playerScores[ownerClientId] += scoreToAdd;
|
|
|
|
playerScores[ownerClientId] = value;
|
|
|
|
UpdatePlayerScore(ownerClientId, playerScores[ownerClientId]);
|
|
|
|
Debug.Log($"[ScoreManager] Updating Player {ownerClientId} score to {playerScores[ownerClientId]}.");
|
|
|
|
|
|
|
|
UpdatePlayerScoreClientRpc(ownerClientId, playerScores[ownerClientId]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Debug.LogError($"[ScoreManager] No entry found for Player {ownerClientId}. Cannot update score.");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void SubtractPlayerScore(ulong ownerClientId, int scoreToSubtract)
|
|
|
|
public int GetPlayerScore(ulong ownerClientId)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (playerScores.TryGetValue(ownerClientId, out var score))
|
|
|
|
if (playerScores.ContainsKey(ownerClientId))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return score;
|
|
|
|
int newScore = Mathf.Max(0, playerScores[ownerClientId] - scoreToSubtract);
|
|
|
|
|
|
|
|
UpdatePlayerScore(ownerClientId, newScore);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Debug.LogError($"[ScoreManager] No entry found for Player {ownerClientId}.");
|
|
|
|
|
|
|
|
return 0; // Default score
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[ServerRpc]
|
|
|
|
[ServerRpc]
|
|
|
@ -113,61 +108,198 @@ public class ScoreManager : NetworkBehaviour
|
|
|
|
private IEnumerator ApplyCrowPenaltyCoroutine()
|
|
|
|
private IEnumerator ApplyCrowPenaltyCoroutine()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
yield return new WaitUntil(() => PlatformManager.Instance != null && PlatformManager.Instance.AreAllPlatformsOccupied());
|
|
|
|
yield return new WaitUntil(() => PlatformManager.Instance != null && PlatformManager.Instance.AreAllPlatformsOccupied());
|
|
|
|
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var modifications = new List<KeyValuePair<ulong, int>>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var entry in playerScores)
|
|
|
|
foreach (var entry in playerScores)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var ownerClientId = entry.Key;
|
|
|
|
ulong ownerClientId = entry.Key;
|
|
|
|
var score = entry.Value;
|
|
|
|
int currentScore = entry.Value;
|
|
|
|
|
|
|
|
|
|
|
|
// Check if the player is the crow
|
|
|
|
|
|
|
|
if (CrowManager.Instance != null && CrowManager.Instance.GetCurrentCrow().OwnerClientId == ownerClientId)
|
|
|
|
if (CrowManager.Instance != null && CrowManager.Instance.GetCurrentCrow().OwnerClientId == ownerClientId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var newScore = score - 2;
|
|
|
|
int newScore = currentScore - 2;
|
|
|
|
modifications.Add(new KeyValuePair<ulong, int>(ownerClientId, newScore));
|
|
|
|
SubtractPlayerScore(ownerClientId, 2);
|
|
|
|
Debug.Log($"[ScoreManager] Applied crow penalty to Player {ownerClientId}. New score: {newScore}");
|
|
|
|
Debug.Log($"[ScoreManager] Applied crow penalty to Player {ownerClientId}. New score: {newScore}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Apply the modifications after the iteration
|
|
|
|
|
|
|
|
foreach (var modification in modifications)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
UpdatePlayerScore(modification.Key, modification.Value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Wait for the next penalty application
|
|
|
|
|
|
|
|
yield return new WaitForSeconds(5f);
|
|
|
|
yield return new WaitForSeconds(5f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[ClientRpc]
|
|
|
|
|
|
|
|
public void UpdatePlayerScoreClientRpc(ulong ownerClientId, int newScore)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Debug.Log($"[ScoreManager] Received score update for Player {ownerClientId}: {newScore}");
|
|
|
|
|
|
|
|
var playerScoreComponent = FindPlayerScoreComponent(ownerClientId);
|
|
|
|
|
|
|
|
if (playerScoreComponent != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
playerScoreComponent.UpdateScore(newScore);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Debug.LogError($"[ScoreManager] Could not find PlayerScoreComponent for Player {ownerClientId}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//using System.Collections;
|
|
|
|
|
|
|
|
//using System.Collections.Generic;
|
|
|
|
|
|
|
|
//using Unity.Multiplayer.Samples.BossRoom;
|
|
|
|
|
|
|
|
//using UnityEngine;
|
|
|
|
|
|
|
|
//using Unity.Netcode;
|
|
|
|
|
|
|
|
|
|
|
|
private PlayerScoreComponent FindPlayerScoreComponent(ulong ownerClientId)
|
|
|
|
//public class ScoreManager : NetworkBehaviour
|
|
|
|
{
|
|
|
|
//{
|
|
|
|
foreach (var scoreComponent in FindObjectsOfType<PlayerScoreComponent>())
|
|
|
|
// public static ScoreManager Instance { get; private set; }
|
|
|
|
{
|
|
|
|
|
|
|
|
if (scoreComponent.OwnerClientId == ownerClientId)
|
|
|
|
// public Dictionary<ulong, int> playerScores = new Dictionary<ulong, int>();
|
|
|
|
{
|
|
|
|
// public Dictionary<ulong, string> playerNames = new Dictionary<ulong, string>();
|
|
|
|
return scoreComponent;
|
|
|
|
|
|
|
|
}
|
|
|
|
// private void Awake()
|
|
|
|
}
|
|
|
|
// {
|
|
|
|
Debug.LogError($"[ScoreManager] Could not find PlayerScoreComponent for Player {ownerClientId}");
|
|
|
|
// if (Instance != null && Instance != this)
|
|
|
|
return null;
|
|
|
|
// {
|
|
|
|
}
|
|
|
|
// Destroy(gameObject);
|
|
|
|
}
|
|
|
|
// return;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// Instance = this;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public override void OnNetworkSpawn()
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// if (IsServer)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// StartCrowPenaltyCoroutineServerRpc();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// [ServerRpc(RequireOwnership = false)]
|
|
|
|
|
|
|
|
// public void InitializePlayerScoreServerRpc(ulong ownerClientId,string name)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// if (!playerScores.ContainsKey(ownerClientId))
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// playerScores[ownerClientId] = 200;
|
|
|
|
|
|
|
|
// Debug.Log($"[ScoreManager] Player {ownerClientId} initialized with a starting score of 200.");
|
|
|
|
|
|
|
|
// UpdatePlayerScoreClientRpc(ownerClientId, 200);
|
|
|
|
|
|
|
|
// playerNames[ownerClientId]= name;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Scoreboard.instance.ScoreBoardItemInitializer(ownerClientId, playerScores[ownerClientId],name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// Debug.LogWarning($"[ScoreManager] Player {ownerClientId} already initialized.");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public void UpdatePlayerScore(ulong ownerClientId, int newScore)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// if (playerScores.ContainsKey(ownerClientId))
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// playerScores[ownerClientId] = newScore;
|
|
|
|
|
|
|
|
// Debug.Log($"[ScoreManager] Updating Player {ownerClientId} score to {newScore}.");
|
|
|
|
|
|
|
|
// UpdatePlayerScoreClientRpc(ownerClientId, newScore);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// Debug.LogError($"[ScoreManager] No entry found for Player {ownerClientId}. Cannot update score.");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public void AddPlayerScore(ulong ownerClientId, int newScore)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// if (playerScores.ContainsKey(ownerClientId))
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// playerScores[ownerClientId] += newScore;
|
|
|
|
|
|
|
|
// Debug.Log($"[ScoreManager] Updating Player {ownerClientId} score to {playerScores[ownerClientId]}.");
|
|
|
|
|
|
|
|
// UpdatePlayerScoreClientRpc(ownerClientId, playerScores[ownerClientId]);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// Debug.LogError($"[ScoreManager] No entry found for Player {ownerClientId}. Cannot update score.");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public void SubtractPlayerScore(ulong ownerClientId, int scoreToSubtract)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// if (playerScores.ContainsKey(ownerClientId))
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// int value = Mathf.Max(0, playerScores[ownerClientId] - scoreToSubtract);
|
|
|
|
|
|
|
|
// playerScores[ownerClientId] = value;
|
|
|
|
|
|
|
|
// Debug.Log($"[ScoreManager] Updating Player {ownerClientId} score to {playerScores[ownerClientId]}.");
|
|
|
|
|
|
|
|
// UpdatePlayerScoreClientRpc(ownerClientId, playerScores[ownerClientId]);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// Debug.LogError($"[ScoreManager] No entry found for Player {ownerClientId}. Cannot update score.");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public int GetPlayerScore(ulong ownerClientId)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// if (playerScores.TryGetValue(ownerClientId, out var score))
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// return score;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// Debug.LogError($"[ScoreManager] No entry found for Player {ownerClientId}.");
|
|
|
|
|
|
|
|
// return 0; // Default score
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// [ServerRpc]
|
|
|
|
|
|
|
|
// public void StartCrowPenaltyCoroutineServerRpc()
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// StartCoroutine(ApplyCrowPenaltyCoroutine());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// private IEnumerator ApplyCrowPenaltyCoroutine()
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// yield return new WaitUntil(() => PlatformManager.Instance != null && PlatformManager.Instance.AreAllPlatformsOccupied());
|
|
|
|
|
|
|
|
// while (true)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var modifications = new List<KeyValuePair<ulong, int>>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// foreach (var entry in playerScores)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var ownerClientId = entry.Key;
|
|
|
|
|
|
|
|
// var score = entry.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // Check if the player is the crow
|
|
|
|
|
|
|
|
// if (CrowManager.Instance != null && CrowManager.Instance.GetCurrentCrow().OwnerClientId == ownerClientId)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// var newScore = score - 2;
|
|
|
|
|
|
|
|
// modifications.Add(new KeyValuePair<ulong, int>(ownerClientId, newScore));
|
|
|
|
|
|
|
|
// Debug.Log($"[ScoreManager] Applied crow penalty to Player {ownerClientId}. New score: {newScore}");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // Apply the modifications after the iteration
|
|
|
|
|
|
|
|
// foreach (var modification in modifications)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// UpdatePlayerScore(modification.Key, modification.Value);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // Wait for the next penalty application
|
|
|
|
|
|
|
|
// yield return new WaitForSeconds(5f);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// [ClientRpc]
|
|
|
|
|
|
|
|
// public void UpdatePlayerScoreClientRpc(ulong ownerClientId, int newScore)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// Debug.Log($"[ScoreManager] Received score update for Player {ownerClientId}: {newScore}");
|
|
|
|
|
|
|
|
// Scoreboard.instance.ScoreBoardUpdater(playerNames[ownerClientId], newScore);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// var playerScoreComponent = FindPlayerScoreComponent(ownerClientId);
|
|
|
|
|
|
|
|
// if (playerScoreComponent != null)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// playerScoreComponent.UpdateScore(newScore);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// Debug.LogError($"[ScoreManager] Could not find PlayerScoreComponent for Player {ownerClientId}");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// private PlayerScoreComponent FindPlayerScoreComponent(ulong ownerClientId)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// foreach (var scoreComponent in FindObjectsOfType<PlayerScoreComponent>())
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// if (scoreComponent.OwnerClientId == ownerClientId)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// return scoreComponent;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// Debug.LogError($"[ScoreManager] Could not find PlayerScoreComponent for Player {ownerClientId}");
|
|
|
|
|
|
|
|
// return null;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|