Save players in match final resume scoreboard

General support.
Post Reply
User avatar
brainpusher1994
New Member
New Member
Posts: 4
Joined: Fri Jul 16, 2021 3:23 am

Hello, dear Lovatto!
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;
in bl_PlayerScoreboard.cs like that

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;
    }
and also paste this line of code

Code: Select all

if (bl_GameManager.Instance.GameFinish) return;
in bl_PlayerScoreboard.cs like that

Code: Select all

public void OnPlayerLeftRoom(Player otherPlayer)
    {
        if (bl_GameManager.Instance.GameFinish) return;
        if (cachedUIBindings.ContainsKey(otherPlayer.ActorNumber))
        {
            RemoveUIBinding(cachedUIBindings[otherPlayer.ActorNumber]);
        }
    }
but with no luck! I still see how people disappear on leave from match final resume. Please help me doing it right! Thank you!
Post Reply