The problem: I would like to see all players that finished game with me on match final resume scoreboard. But as soon as player leaves he disappears from match final resume scoreboard as well. Could you point me what should I add/change to make it work. The main idea was not to remove player UI binding OnLeave() if game was finished.
I have tried to paste this line of code
Code: Select all
public if (bl_GameManager.Instance.GameFinish) return true;
Code: Select all
public bool RemoveUIBinding(bl_PlayerScoreboardUI uiBinding)
{
if (bl_GameManager.Instance.GameFinish) return true;
if (uiBinding.isBotBinding)
{
if (cachedBotsUIBindings.ContainsKey(uiBinding.Bot))
{
Destroy(cachedBotsUIBindings[uiBinding.Bot].gameObject);
cachedBotsUIBindings.Remove(uiBinding.Bot);
return true;
}
}
else
{
if (cachedUIBindings.ContainsKey(uiBinding.cachePlayer.ActorNumber))
{
Destroy(cachedUIBindings[uiBinding.cachePlayer.ActorNumber].gameObject);
cachedUIBindings.Remove(uiBinding.cachePlayer.ActorNumber);
return true;
}
}
return false;
}
Code: Select all
if (bl_GameManager.Instance.GameFinish) return;
Code: Select all
public void OnPlayerLeftRoom(Player otherPlayer)
{
if (bl_GameManager.Instance.GameFinish) return;
if (cachedUIBindings.ContainsKey(otherPlayer.ActorNumber))
{
RemoveUIBinding(cachedUIBindings[otherPlayer.ActorNumber]);
}
}