wesleywh / EasyMultiplayer-Invector

Where to submit issues for "Easy Multiplayer - Invector" suite of packages that is available via GumRoad or the Unity Asset Store. GUMROAD: https://cyberbulletgames.gumroad.com/ ASSET STORE: https://assetstore.unity.com/publishers/34070
0 stars 0 forks source link

Damage indicator / Direction of bullet + Leaderboard #11

Closed AmmarTee closed 2 years ago

AmmarTee commented 2 years ago

Damage indicator would be amazing if player could see where the bullet came from. The damage indicator on the UI

Along with that:

If possible: it would be much nicer to have player name sorted by the kill count on the leaderboard :)

wesleywh commented 2 years ago

For the sorted names in dictionary override KillCountUpdated function in the KillCounterPlayerList like the following:

using System.Linq;
...
...
protected override void KillCountUpdated(Dictionary<int, int> killCounter)
{
            string playerName;
            string tmpString = "";
            Dictionary<string, int> playerNameDictionary = new Dictionary<string, int>();
            foreach (KeyValuePair<int, int> item in killCounter)
            {
                ClientConnection conn = ClientUtil.GetClientConnection(item.Key);
                playerName = (conn == null || string.IsNullOrEmpty(conn.playerName)) ? item.Key.ToString() : conn.playerName;
                playerNameDictionary.Add(playerName, item.Value);
            }
            foreach (KeyValuePair<string, int> item in playerNameDictionary.OrderByDescending(x => x.Key))
            {
                tmpString += $"{item.Key} : {item.Value}\n";
            }
            if (textComp) textComp.text = tmpString;
}

There might be a few mistakes in the above but I'm sure you can figure it out. If you want to learn more about the KillCounter functions and prefabs read the documentation here: https://cyberbulletgames.com/easy-multiplayer-invector-ui-docs/Prefabs/KillCounter/KillCounter/

wesleywh commented 2 years ago

I have generated an example image and prefabs. I will be making tutorial videos and documentation for this before I release it. I might also spend some time making youtube tutorials for it as well.

Either way this has been completed and will be available in the next UI release v0.4.0

AmmarTee commented 2 years ago

Next UI release is not currently available on Gumroad